Advertisement
silver2row

Trying_Random_Source_from_

Jan 2nd, 2025
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. #!/usr/bin/python3
  2.  
  3. import gpiod
  4. import time
  5.  
  6. CHIP = "gpiochip2"
  7.  
  8. gpio32 = gpiod.find_line('GPIO16')
  9. gpio32.request(consumer='Stepper', type=gpiod.LINE_REQ_DIR_OUT, default_val=0)
  10.  
  11. gpio33 = gpiod.find_line('GPIO17')
  12. gpio33.request(consumer='Stepper', type=gpiod.LINE_REQ_DIR_OUT, default_val=0)
  13.  
  14. #gpio35 = gpiod.find_line('GPIO18')
  15. #gpio35.request(consumer='Stepper', type=gpiod.LINE_REQ_DIR_OUT, default_val=0)
  16.  
  17. #gpio35.set_value(1)
  18.  
  19. try:
  20.     while True:
  21.         gpio32.set_value(1)
  22.         time.sleep(2)
  23.         gpio32.set_value(0)
  24.         time.sleep(2)
  25. except KeyboardInterrupt:
  26.     gpio32.set_value(0)
  27.     print("Okay then...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement