I want to control the speed of a DC Motor using the arduino element of the EJS.
In the Initialization page I have the following command: arduino.setDigitalMode(9,3); which according to the documentation sets the mode of a digital pin 9 to PWM.
Then in the fixed relations page I have the command: arduino.writeDigital(9,speed); where speed is an integer variable with values between 0 and 255.
I get a compilation error by this second command "Some messages have been simplified; recompile with -Xdiags:verbose to get full output"
writeDigital(int pinNumber, boolean state) is used for a digital output. What you want is to generate a PWM output. Therefore, you need to use the command writeDigitalValue(int pinNumber, int value), instead.
thank you very much for your help. It worked with your suggestion.
The confusion was because of the arduino documentation in ejs. It refers to a function writeDigital(int pinNumber, boolean state) and to another function writeDigital(int pinNumber, int value).