summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/scilab-arduino/cmd_analog_out_volt
diff options
context:
space:
mode:
authorBrijeshcr2017-07-10 12:41:21 +0530
committerGitHub2017-07-10 12:41:21 +0530
commit2e9eadc75e51483c41a30544496b4e05c0cf7c41 (patch)
tree603cb29022e575db10ab26fbb75a5cc5bdf01ad8 /2.3-1/src/c/scilab-arduino/cmd_analog_out_volt
parent26ab8620e89571314bc1a828bd9aca3d288eaede (diff)
parent09d11751736a5812ebfc22cd488f51de02e5375a (diff)
downloadScilab2C-2e9eadc75e51483c41a30544496b4e05c0cf7c41.tar.gz
Scilab2C-2e9eadc75e51483c41a30544496b4e05c0cf7c41.tar.bz2
Scilab2C-2e9eadc75e51483c41a30544496b4e05c0cf7c41.zip
Merge pull request #14 from yash1112/master
Arduino toolbox error Resolved
Diffstat (limited to '2.3-1/src/c/scilab-arduino/cmd_analog_out_volt')
-rw-r--r--2.3-1/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/2.3-1/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c b/2.3-1/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c
index 2dd82e41..1d76b601 100644
--- a/2.3-1/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c
+++ b/2.3-1/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
}