61 lines
1.1 KiB
Plaintext
61 lines
1.1 KiB
Plaintext
on System#Boot Do
|
|
OLEDCMD,clear
|
|
OLED,1,1,"Pompsturing Dompelpomp"
|
|
GPIO,10,1
|
|
Monitor GPIO, 3
|
|
Endon
|
|
|
|
On GPIO#3=0 Do
|
|
OLED, 7,1, "0 %eventvalue1%"
|
|
TaskValueSet,status,xauto,0
|
|
Endon
|
|
On GPIO#3=1 Do
|
|
OLED, 7,1, "1 %eventvalue1%"
|
|
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
|
|
|