Page 291 - Making PIC Microcontroller Instruments and Controllers
P. 291
PBOJECT 6 2e1
Sre Flnal segment to make a finished program-ihe touch panel
(Continuecl)
EIID SEI.ECT
CASE EI.SE
END SE'.ECT
;The following segmenr of code uses lhe lwo r'time counters" to
;turn the two LEDS on
;and off as specined by lhe fasrer/slower buttons. It counts each
; Elrnrng sequence
; independentty and lurns lhe related LED on and off.
lF LCD I=ACTIVE IIHEN
IF STAI-I=BLINR THEN
AI,PEA=AJ.PI'A +1 i
IF lJrPEA>=! 0 THEN ;
AIPEA=o i
TOGCI.A I,CD.ONE
ENDIF
ENDIF
ENDIF
IF LCD,2 EACTIVE THEIiI
IF STAI-2 EBLINK THEDI
BEIA=BEIIA +1 ;
IF BEIA>=|!IMl TXEN
BEIA=0
TOGSI.E LCD_TWO
ENDIF
ENDIF
ENDIF
RETURN
PAITSER! ; pause to de bounce, long
aOR x=1 TO 300
PAUSE 1
NEK
