SolarTracker based on time- my first rules

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
nobody@all
Normal user
Posts: 16
Joined: 09 Apr 2017, 23:27

SolarTracker based on time- my first rules

#1 Post by nobody@all » 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.

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
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.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests