How do people get analog values? (Question)
I just had a question burning in my head. How do people get analog values from thier accelerometers, potentiometers, Sharp infared proximity sensors? How do you guys find those values that you can plug in the PICAXE?



@ Mon, 2009-08-24 03:34
what he said
all picaxes have at least one Analog to Digital Converter. the 28x1 has 4. You just plug your analog into the input pin and program:
readadc x,y (where x is the input pin # and y is the variable)
... and your axe will give you a value from 0 to 255.
As far as what those values MEAN, that depends entirely on the sensor you are connecting.
@ Mon, 2009-08-24 03:22
Your micro needs an ADC. You
Your micro needs an ADC. You may already have one, in which case the documentation will explain what commands are needed to read the value.
For comparing the sensor data, the sensor might have information on what kind of analog level it will output. For example a distance sensors datasheet might have a graph showing what voltage is output for what distance is detected.
Or you can just experiment. Make a program to constantly output the analog info to a debug window on the computer then just put your hand in front of the sensor. Check the distance and the analog output.
@ Mon, 2009-08-24 22:37
I dont really know how to
@ Tue, 2009-08-25 04:50
debug
symbol value = b0
symbol device = 0 'or whichever pin you're using
do
readadc device, value
debug
loop
@ Tue, 2009-08-25 00:41
Read through the "Start