APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Problems reading EJS variable from Arduino. post and replies

Return to the Problems reading EJS variable from Arduino. thread
Login to post to this thread

Problems reading EJS variable from Arduino.
Baltasar Sanchez
1 Posts

Paco good afternoon. I'm working with EJS and Arduino. I can move a motor and control its speed. The difficulty I have with EJS attempting to read a value from an analog input. In the StandardFirmata he sent the information: "firmata.sendAnalog(analogPin, varPin); "
In EJS I use
arduino.setDigitalMode(5, 2);
valorRPM= arduino.readAnalog(5);
Try many modifications without success. It brings only the first value. It's like EJS is a buffer of information, I must reboot to run well. Is only the first reading works well, then do not update, repeat the same value. Please give me you prune a hand. Thank you very much. Greetings. Baltasar


OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book