Channel - is a variable/constant specifying the ADC channel (not pin number)
Wordvariable - receives the data word read.
Read the ADC channel (10 bit resolution) contents into wordvariable.
On X2 parts you must use the ADC channel, not the pin number, in the readadc10 command (e.g. readadc10 0,w1 NOT readadc10 A.0, w1). The readadc10 command is used to read the analogue value from microcontrollers with 10-bit capability. Note that not all inputs have internal ADC functionality - check the pinout for the PICAXE chip you are using. As the result is 10 bit a word variable must be used - for a byte value use the readadc command instead.
When using the debug command to output 10 bit numbers, the electrical connection to the computer via the old AXE026 serial download cable may slightly affect the ADC values. In this case it is recommended that the 'enhanced' interface circuit is used on a serial connection. The Schottky diode within this circuit reduces this issue.
Submit Your Own Code!
You must be logged in to submit code examples. Login now.