Ladies and Gents,
I've been playing around with the 10F222 and its sleep/wake on pin change. Not trying to show my ineptness here but what do they mean by reading the input pins? This code works:
Code:
CLEAR
DEFINE OSC 4
adcon0 = 0 ' Turn off ADC
option_reg = %00001000 ' enable wake on pin, weak pull ups, prescaler to wdt
osccal = %00000000 ' oscillator calibration
trisio = %1101 ' GP1 only is output
gpio = 0 ' turn everything off
LED VAR gpio.1
i VAR BYTE
start_here:
IF gpio.0 = 0 THEN GOSUB Light_LED
IF gpio.3 = 0 THEN GOSUB Light_LED
SLEEP 5
GOTO start_here
Light_LED:
i = 0
FOR i = 0 TO 3
TOGGLE LED
PAUSE 8000
NEXT i
RETURN
END
I'd like to know if I did it right or is there something more subtle, or bodacious, I should be doing.
I've, I think, attached the page and my code. Constructive help greatly appreciated.
Bookmarks