Hi,
I'm sorry I didn't explained myself right. I ment to say that I get the same error when I'm using the readadc command (I have actually just tried jcmaco's code and it runs ok - doesn't turn output 2 high). Nonetheless, when i use this code:
init:
pwmout 3,64,255
b1 = 255
main:
readadc 0,b0
if b0 >= 36 and b0 < 72 then red_led
pause 500
if b0 >= 72 and b0 < 108 then green_led
pause 500
if b0 >= 108 and b0 < 144 then blue_led
pause 500
if b0 >= 144 and b0 < 180 then white_led
pause 500
if b0 >= 180 and b0 < 216 then dec_bright
pause 500
if b0 >= 216 and b0 < 255 then inc_bright
pause 500
goto main
red_led:
toggle 0
goto main
green_led:
toggle 1
goto main
blue_led:
toggle 2
goto main
white_led:
high 0,1,2
goto main
dec_bright:
if b1 = 0 then main
b1 = b1 - 5
pwmout 3,64,b1
goto main
inc_bright:
if b1 = 255 then main
b1 = b1 + 5
pwmout 3,64,b1
goto main
---
when it gets to the "Main: readadc 0, b0" it turns output 2 high. Should this happen? Is it something to do with my code?
Note that I haven't tried this code in a real Picaxe, since I'm expecting to get it this week, so I don't know if it is a bug in the simulator or it real happens with the real chip.
Please let me know if this is a bug or is a problem with my code.
Thank you!
Pfrogs
Ps: I'm running Picaxe Programming editor 5.2.1 on Windows XP Pro SP2
Ps to Technical: with my program the Pins (out) on the variables section reads "12 | %00001100"