Today I receive my first PICAXE-08M and I was just testing what I have learned. This code should read an analog value and, if it is greater than zero, blink the led once. Every analog read should be sent to the serial port. If no reading is done then every second the "testing" test + w1 content is sent to the computer. But, when something greater than 0 is read, the text and value is sent, the led blinking enters a loop and no more reading are sent to the computer.
Code:
symbol ADCPORT = 2
symbol LEDPORT = 1
main:
w1 = 0
readadc10 ADCPORT, w1
sertxd ("testing", #w1, 13, 10)
if w1 = 0 then nextone
gosub blinkled
nextone:
pause 1000
goto main
blinkled:
high LEDPORT
sleep 100
low LEDPORT
return