Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. from pysolar.solar import *
  2. import datetime
  3. import pytz
  4. import RPi.GPIO as GPIO
  5.  
  6. GPIO.setmode(GPIO.BCM)
  7.  
  8. GPIO.setup(16, GPIO.OUT) #richtung 0=links // 1=rechts
  9. GPIO.setup(20, GPIO.OUT) #vertikal
  10. GPIO.setup(21, GPIO.OUT) #horizontal
  11. GPIO.setup(19, GPIO.IN) #endlage_vertikal
  12. GPIO.setup(26, GPIO.IN) #endlage_horizontal
  13.  
  14.  
  15. GPIO.output(16, GPIO.LOW) #richtung
  16. GPIO.output(20, GPIO.LOW) #vertikal
  17. GPIO.output(21, GPIO.LOW) #horizontal
  18.  
  19. endlage_vertikal = GPIO.input(19)
  20. endlage_horizontal = GPIO.input(26)
  21.  
  22. first_run = 1
  23.  
  24. while(first_run == 1)
  25. GPIO.output(16, GPIO.LOW) #links
  26. GPIO.output(20, GPIO.HIGH) #takt
  27. time.sleep(0.001)
  28. GPIO.output(20, GPIO.LOW)
  29. if(endlage_vertikal == 1)
  30. first_run = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement