Update rules1.txt

This commit is contained in:
Ton 2024-03-13 19:20:03 +01:00
parent 66de6e4751
commit 9a7ded281c

View File

@ -1,14 +1,60 @@
on System#Boot do on System#Boot Do
GPIO,2,0 OLEDCMD,clear
LoopTimerSet,1,10 OLED,1,1,"Pompsturing Dompelpomp"
endon GPIO,10,1
Monitor GPIO, 3
on laag#State do Endon
LogEntry,'laag#State: %eventvalue1% result: %eventvalue2%'
On GPIO#3=0 Do
if [laag#State]=1 OLED, 7,1, "0 %eventvalue1%"
GPIO,2,0 TaskValueSet,status,xauto,0
else Endon
GPIO,2,1 On GPIO#3=1 Do
endif OLED, 7,1, "1 %eventvalue1%"
endon TaskValueSet,status,xauto,1
Endon
on manual#State do
If [manual#State] = 1
NeoPixel,4,0,255,0
GPIO,3,0
oledcmd,on
OLED,2,1,"pomp handmatig "
timerSet, 1, 3
Else //off
NeoPixel,4,0,22,0
GPIO,3,1
oledcmd,on
OLED,2,1,"pomp automatisch "
Endif
Endon
on bovenste#State do
If [bovenste#State] = 1 and [onderste#State] = 1 And [status#xauto]=0
NeoPixel,2,0,255,0
GPIO,3,1
oledcmd,on
OLED,2,1,"pomp wordt aangezet "
timerSet, 1, 3
Endif
Endon
on onderste#State do
If [onderste#State] = 0
NeoPixel, 2,20,20,20
GPIO,3,0 //pomp uit
oledcmd,on
OLED,2,1,"pomp uitgeschakeld "
Endif
Endon
On Rules#Timer=1 do
If [onderste#State] = 1
OLEDCMD,clear
OLED, 2, 1, "pomp werkt niet!"
tone,10,1300,200
TimerSet, 1, 2
Endif
Endon