SolarTracker based on time- my first rules
Posted: 10 Jul 2018, 00:22
Hello. Using this forum and youtube I have been write (my first) some rules to control my water solar panel to trucking the sun.
Can I ask someone to check if this is ok. On my desk it is working very well, i didn't check this in real life.
Code: Select all
//gpio2- engine speed from East to West
//gpio14- engine speed from West to East
// on every boot setting solar to East (after reboot encoder state is 0 and we don't know realy position
of solar) and wait for specified time.
On System#Boot do
gpio,14,0
timerSet,1,300
endon
On Rules#Timer=1 do
gpio,2,1
endon
//on specified time every day switch ON the gpio2
On Clock#Time=ALL, 10:00 do
gpio,2,0
endon
//gpio2 stays ON until rotary encoder will be 5 then turn gpio2 OFF
On solar#state do
if [solar#state]=5
gpio,2,1
endif
endon
On Clock#Time=ALL, 11:00 do
gpio,2,0
endon
On solar#state do
if [solar#state]=15
gpio,2,1
endif
endon
// on every evening setting solar to East and wait for morning.
On Clock#Time=ALL, 20:00 do
gpio,14,0
timerSet,2,300
endon
On Rules#Timer=2 do
gpio,2,1
endon