Advertisement
silver2row

PWM_File_For_Testing

Sep 4th, 2022
1,100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. #!/usr/bin/python3
  2.  
  3. from PWM_ideasTwo import PWM as PWM
  4. from time import sleep
  5.  
  6. try:
  7.     abort = int(input("Please enter a 0 or 1: "))
  8.     if abort >= 1:
  9.         PWM.start = 0
  10.         PWM.set_frequency = 50
  11.         PWM.set_duty_cycle = 10
  12.         sleep(5)
  13.  
  14.     else:
  15.         PWM.set_frequency = 80
  16.         PWM.set_duty_cycle = 10
  17.         sleep(5)
  18.  
  19. except KeyboardInterrupt:
  20.     print ("Hello!")
  21.     PWM.stop
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement