You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get the value of a sensor on regular intervals. I try running this simple code
require "arduino_firmata"
arduino = ArduinoFirmata.connect "/dev/ttyACM0"
5.times do
puts arduino.analog_read(1)
sleep 5
end
arduino.close
but I get the same value regardless how the conditions for the sensor change.
If I put the arduino initialisation and close within the loop it works, but this is far from optimal way of doing it. I'd like to be able to initialise the object and work with it for a while before closing.
I'm running it with Firmata 2.4.0 on a raspberry pi.
Any ideas?
Thanks,
Kamen
The text was updated successfully, but these errors were encountered:
Hi,
I'm trying to get the value of a sensor on regular intervals. I try running this simple code
but I get the same value regardless how the conditions for the sensor change.
If I put the arduino initialisation and close within the loop it works, but this is far from optimal way of doing it. I'd like to be able to initialise the object and work with it for a while before closing.
I'm running it with Firmata 2.4.0 on a raspberry pi.
Any ideas?
Thanks,
Kamen
The text was updated successfully, but these errors were encountered: