Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- from PWM import Pwm
- from time import sleep
- # Use for PWM on /dev/bone/pwm/
- # see https://pastebin.com/R70P1wAn
- LED = Pwm('/dev/bone/pwm/1/b', frequency=50)
- try:
- while True:
- LED.value = 0.8
- sleep(5)
- LED.value = 0.0
- sleep(5)
- for i in range(0, 1):
- Pwm.duty_cycle(LED, i)
- sleep(0.2)
- for i in range(1, 0, 1):
- Pwm.duty_cycle(LED, i)
- sleep(0.2)
- except KeyboardInterrupt:
- print ("You have done it now!")
- LED.disable()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement