Advertisement
Guest User

Untitled

a guest
Aug 13th, 2020
1,291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. import utime
  2. import hub
  3. from hub import port
  4.  
  5. port.A.mode(port.MODE_FULL_DUPLEX)
  6. a=port.A
  7. a.baud(115200)
  8.  
  9. i=0
  10. while True:
  11.     utime.sleep_ms(150)
  12.     p=hub.button.center.was_pressed()
  13.     if p==True:
  14.         i=i+1
  15.         hub.display.show(i)
  16.         print("Send: " + str(i))
  17.         a.write(str(i))
  18.         if i==9:
  19.             i=0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement