Advertisement
CatNamedWill

watch

Jun 6th, 2023
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. import radio
  2. import music
  3. from microbit import *
  4. stepcounter=0
  5. radio.config(group=1)
  6.  
  7. while True:
  8.     display.set_pixel(0,0,9)
  9.     message = radio.receive()
  10.     if message:
  11.         display.set_pixel(1,0,9)
  12.         if message=='+1':
  13.             stepcounter+=1
  14.         if message=='you have reached your daily goal':
  15.             music.play(['e','d','e','f'])
  16.     if pin_logo.is_touched():
  17.         display.set_pixel(2,0,9)
  18.         radio.send('short')
  19.     if button_b.is_pressed():
  20.         display.set_pixel(3,0,9)
  21.         radio.send('long')
  22.     if button_a.is_pressed():
  23.         display.set_pixel(4,0,9)
  24.         display.scroll(stepcounter)
  25.     sleep(100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement