diff options
Diffstat (limited to 'src/c/scilab-arduino/cmd_analog_out_volt')
-rw-r--r-- | src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c b/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c index 2dd82e4..1d76b60 100644 --- a/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c +++ b/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c @@ -15,8 +15,8 @@ void u8cmd_analog_out_volts(uint8 board_no, uint8 pin, float value) { - int a; - a = ((value*255)/5); - analogWrite(pin,a); + int a; //declaring variable + a = ((value*255)/5); //converting given voltage to duty cycle value (0 - 255) + analogWrite(pin,a); //passing pin no. and duty cycle value } |