Sunday, May 13, 2018
s-retract.py actuator script
import RPi.GPIO as GPIO
import time
# CHECK wires at RPi header for loose connections when problems occur
# HIGH is low and LOW is high in GPIO using the RPi.GPIO library
# ADD PWM
# 35 seconds is the actuator run time from beginning to end.
# Initialize software and hardware
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(26,GPIO.OUT)
GPIO.setup(19,GPIO.OUT)
GPIO.setup(13,GPIO.OUT)
GPIO.setup(6,GPIO.OUT)
# Shut all relays off. Relays are usually off on power up.
GPIO.output(26,GPIO.HIGH)
GPIO.output(19,GPIO.HIGH)
GPIO.output(13,GPIO.HIGH)
GPIO.output(6,GPIO.HIGH)
print('Initialized.')
#####################
# Do this at the end of the day, at 6:00 PM
#Retract on
GPIO.output(26,GPIO.LOW)
GPIO.output(19,GPIO.LOW)
print('Retracting...')
time.sleep(32)
#Retract off
GPIO.output(26,GPIO.HIGH)
GPIO.output(19,GPIO.HIGH)
print('Retraction done.')
Subscribe to:
Post Comments (Atom)
RPi4 standalone wifi
The RPi4/Bookworm12 offers a hotspot option from wiithin the GUI. That works but there are issues. I ran across a more direct method using...
-
In a recent post I presented the equation for energy incident on a solar panel (Sm). Here I present the set of equations used to calcu...
-
This java script makes sure the date is correctly interpreted between PHP and HTML. I found this on the web: CODE //<script> /** ...
-
A python script to calculate solar position without use of ephemeris library. The script is imperfect. When the sun goes down, the posit...
No comments:
Post a Comment