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?

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.

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.

I dont really know how to
I dont really know how to make it display the anolg values on a debug winndow. Is there a sample code for that?

Read through the "Start
Read through the “Start here” link and search the page for the debug command. Fritzl put a good overview of how to do a lot of basic stuff in there.

debug

symbol value = b0

symbol device = 0 'or whichever pin you’re using

do

readadc device, value

debug

loop