Re: Advices required for Soap dispenser / sanitizer code
IF you use the comparator its as simple as this.it won't re-arm itself until hand is removed

Code:
#config
__config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON
#endconfig
DEFINE OSCCAL_1K 1
DEFINE OSC 4
CMCON = %00001110
TRISIO = %111011
vrcon=$88 ;about vcc on 2
ANSEL=1
tmp var byte
Main:
intcon=$40
pir1=0
PIE1=8
asm
SLEEP
nop
endasm
if CMCON.6 then
gpio.2=1
pause 1000
gpio.2=0
endif
goto main
END
Last edited by richard; - 12th September 2020 at 12:25.
Warning I'm not a teacher
Bookmarks