- Name:
-
readadc
- Syntax:
-
READADC channel,variable
Channel - is a variable/constant specifying the ADC channel (not pin number)
Variable - receives the data byte read.
- Description:
-
Read the ADC channel (8 bit resolution) contents into variable.
The readadc command is used to read the analogue value from the microcontroller input pins. Note that not all inputs have internal ADC functionality - check the pinout diagrams for the PICAXE chip you are using. On X2 parts you must use the ADC channel, not the pin number, in the readadc command (e.g. readadc 0,w1 NOT readadc A.0, w1). The readadc10 command can be used for higher resolution.