Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pysolar.solar import *
- import datetime
- import pytz
- import RPi.GPIO as GPIO
- GPIO.setmode(GPIO.BCM)
- GPIO.setup(16, GPIO.OUT) #richtung 0=links // 1=rechts
- GPIO.setup(20, GPIO.OUT) #vertikal
- GPIO.setup(21, GPIO.OUT) #horizontal
- GPIO.setup(19, GPIO.IN) #endlage_vertikal
- GPIO.setup(26, GPIO.IN) #endlage_horizontal
- GPIO.output(16, GPIO.LOW) #richtung
- GPIO.output(20, GPIO.LOW) #vertikal
- GPIO.output(21, GPIO.LOW) #horizontal
- endlage_vertikal = GPIO.input(19)
- endlage_horizontal = GPIO.input(26)
- first_run = 1
- while(first_run == 1)
- GPIO.output(16, GPIO.LOW) #links
- GPIO.output(20, GPIO.HIGH) #takt
- time.sleep(0.001)
- GPIO.output(20, GPIO.LOW)
- if(endlage_vertikal == 1)
- first_run = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement