I see an analog port issue going around.
It happens to all of us, or does it?
Also, where do you turn OFF the LEDs?
Once you set them HIGH, when will they get set LOW?
------------------------------
new var byte
led1 var PORTA.2
led2 var PORTA.3
adcon.1 = 7
main:
new = 0
serout porta.0, T9600, ["Enter which LED to light (1-2,0=Off): ", 10, 13]
serin porta.1, T9600, new
serout porta.0, T9600, ["LED Chosen: ", new, 10, 13]
if new = "1" then
high led1 : low led2
enfif
if new = "2" then
high led2 : low led1
endif
if new = "0" then
low led1 : low led2
endif
goto main
Savnik,
Take a look at the post before yours.
skimask has it for you.
------------------------
No.
I try now with toggle and work.
Thank you.
I add this:
if new = 1 then toggle led1
if new = 2 then toggle led2
The only problem now is :
when power up for the first time , i must press the number 2 > enter and again the number 2 > enter to turn the led on (only for number 2 - not for number 1)
After this no need second time to press the number 2.
Last edited by savnik; - 17th January 2007 at 14:13.
Bookmarks