Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import gpiod
- import time
- CHIP = "gpiochip2"
- gpio32 = gpiod.find_line('GPIO16')
- gpio32.request(consumer='Stepper', type=gpiod.LINE_REQ_DIR_OUT, default_val=0)
- gpio33 = gpiod.find_line('GPIO17')
- gpio33.request(consumer='Stepper', type=gpiod.LINE_REQ_DIR_OUT, default_val=0)
- #gpio35 = gpiod.find_line('GPIO18')
- #gpio35.request(consumer='Stepper', type=gpiod.LINE_REQ_DIR_OUT, default_val=0)
- #gpio35.set_value(1)
- try:
- while True:
- gpio32.set_value(1)
- time.sleep(2)
- gpio32.set_value(0)
- time.sleep(2)
- except KeyboardInterrupt:
- gpio32.set_value(0)
- print("Okay then...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement