Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from microbit import *
- import radio
- radio.config(group=1)
- steps=0
- stepcounter=0
- dailystepbeep=20
- while True:
- message=radio.receive()
- if message:
- if message=='short':
- dailystepbeep-=10
- if message=='long':
- dailystepbeep+=10
- if accelerometer.was_gesture('shake'):
- steps += 1
- stepcounter+=1
- radio.send('+1')
- if steps==dailystepbeep:
- radio.send('you have reached your daily goal')
- steps=0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement