Advertisement
cmass

스마트 교통 신호등_UP

Nov 18th, 2019
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. from microbit import *
  2.  
  3. x = Image('90009:09090:00900:09090:90009')
  4. o = Image('09990:90009:90009:90009:09990')
  5.  
  6. while True:
  7.     pin0.write_digital(1)
  8.     display.show(x)
  9.     sleep(3000)
  10.     pin0.write_digital(0)
  11.     pin1.write_digital(1)
  12.     display.show(o)
  13.     sleep(5000)
  14.     pin0.write_digital(1)
  15.     pin1.write_digital(1)
  16.     display.clear()
  17.     sleep(2000)
  18.     pin0.write_digital(0)
  19.     pin1.write_digital(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement