Sunday, May 13, 2018
s-extend.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
#Extend on 12 seconds
#Extend on
GPIO.output(13,GPIO.LOW)
GPIO.output(6,GPIO.LOW)
print('Extending...')
time.sleep(16)
#Extend off
GPIO.output(13,GPIO.HIGH)
GPIO.output(6,GPIO.HIGH)
print('Extension done.')
Subscribe to:
Post Comments (Atom)
RPi4b storage memory: SD to SSD conversion
Ordinarally, the RPi uses an SD card for memory storage. Those cards have gained a reputation for unreliability. My suspicion is oxidation ...
-
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...
-
Some things have happened since the last post. I found an equation for the irradiation on a solar panel. The equation takes into accou...
-
Python version problems Different versions of Python have enough differences to be troublesome. Version 2.7.4 calculations use im...
No comments:
Post a Comment