Analog Input Poll

Timmay

Member
Licensed User
Longtime User
Hi,

I am trying to poll an analog input on the IOIO. I am using a tick timer, with a sampling rate of 1000 Hz.
Basically, I am getting an error when I put the following code in tick timer sub-routine:
volts = Ana.Voltage
volts has been declared as a float
Ana has been declared as an AnalogInput and Ana = YOYO.OpenAnalogInput(34) was put in an earlier sub-routine.
There are lots of errors, saying stuff hasn't been initialised, but it has. Also, it sayslayout not available.
But the above code, volts = Ana.Voltage , is the break point.
When I put volts = Ana.Voltage outside the tick timer sub-routine, I get no errors, but this is not much good to me as I only get the very first value of the analog input which is read.
Is is that you can't put the .Voltage command in a tick timer sub?
If so, does anyone know how else I might poll the analog input?

Thanks
 
Last edited:
Top