This has taken me ages, it's a modification to Joe's program he posted earlier in the thread (with some of mackrackit's mixed in for good measure) plus some of mine.
The thing is this: Is this a valid program in that GPIO.4 goes high & low and lights the LED due to the: THEN GPIO.4 = 1 / LET GPIO.4 = 0 program statements? I'm not sure if I've made another little bit of progress here, or just lucked in (the right LED does blink).
When you guys have a minute could you check it out please.
GPIO = %00000000 ' set all outputs low
TRISIO = %11001111 'Set GPIO.4&5 to input
CMCON0 = %00000111 'Disable analog comparators
ANSEL = %00000000 'disable analog select so ports work as digital i/o
main:
PAUSE 3000
IF GPIO.5 = 0 THEN GPIO.4 = 1 'turn it on by making pin 4 high +5V
pause 500
LET GPIO.4 = 0 'turn it off: Pin 4 goes low 0V
goto main ' Loop
end
Cheersave
Bookmarks