Advertisement
wandrake

Untitled

Dec 10th, 2014
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. ########################################
  2. # file:    main.py
  3. # project: Timers
  4. # created: 2014-12-02 20:46:12.843231
  5. ########################################
  6.  
  7.  
  8. pinMode(13, OUTPUT)
  9. pinMode(21, OUTPUT)
  10.  
  11. def red():
  12.     while True:
  13.         digitalWrite(13, 0)
  14.         sleep(500)
  15.         digitalWrite(13, 1)
  16.         sleep(500)
  17.  
  18. def yellow():
  19.     while True:
  20.         digitalWrite(21, 0)
  21.         sleep(250)
  22.         digitalWrite(21, 1)
  23.         sleep(250)
  24.        
  25. thread(red)
  26. thread(yellow)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement