Readadc

I am trying to reaquaint myself with picaxe after several years of non use.
Useing a Picaxe 18m2
I am trying to read a POT (on a breadboard) it is simply wired to the same 5v supply with the "wiper" connected to c.0 the resulting debug output is just a series of random numbers
main:
readadc c.0,b1
debug
pause 1000
goto main
If I put a thermistor in instead same thing.. if i put the 10k resistor to 0v in the circuit as per picaxe manual I get 0 in the debug.
what am i doing wrong?
 

hippy

Ex-Staff (retired)
With one side of the pot to 5V, the other to 0V, wiper to C.0 , Leg 17 on an 18M2, your code should work, the value changing as the pot is turned.

You can try the following which will isolate the 'b1' value which can help make behaviour easier to see -
Code:
#picaxe 18M2
#no_data
#terminal 4800
main:
  readadc C.0, b1
  sertxd(#b1, " ")
  pause 1000
  goto main
If that's not behaving as expected I would suspect there's a wiring issue, something not connected quite right.
 
Many Thanks,
same results
have to admit there are quite a few things on my breadboard so i will start again from scratch.

Thank you
 

inglewoodpete

Senior Member
Refer to Manual 3 (Accessible through the Programme Editor's File>Help Menu) - "Input Device 2 - Potentiometer", then move on to "Input Device 3 - Light Dependant Resistor". For the second experiment, substitute your thermistor for the LDR.
 
Top