14M readadc

markhommer

New Member
I am using a picaxe 14M. I am needing two adc's for my project. I am using the ADC 4 (on physical leg 3) and this one is working. But I have tried using ADC 0 (on physical leg 7) but I get the following compile error message "Error pin0 cannot be used with this command", where my command is readadc 0, b4.

I have tried to use the "let dirsc" command to redefine the portc pins for adc's but I get the following message "Error: let dirsc command not supported in this mode!".

I am using program editor ver 5.1.5 and I have 14M selected as the picaxe mode in the options.

Does anyone know where I am going wrong with this readadc command? Or are there other pins that can be used as ADC's.

Thanks in advance.

Mark.
 

SD2100

New Member
Should work ???, have a look at Picaxe manual 1 Appendix C for other analog inputs on pins 8, 9 & 10

Flashes led on output 5 while reading ADC pin0
Code:
#picaxe 14m
do
    toggle 5
    pause 500
    readadc 0,b0
    debug
loop
Sets all portc as inputs and C2(output5) as output
Code:
#picaxe 14m
let dirsc = %00000100
do
    toggle 5
    pause 500
    readadc 1,b0
    debug
loop
Checked both of these in the 14M and they worked ok
 
Last edited:

markhommer

New Member
Thanks for the quick replies.
I learned something...
The readadc 0,b0 & let dirsc commands only work when you have Enhanced compiler selected. I had the Standard compiler selected.

Thanks again.
 
Top