Skip to content

Instantly share code, notes, and snippets.

@andreagrandi
Created March 18, 2016 15:31
Show Gist options
  • Save andreagrandi/9d749543888cc5c7b08c to your computer and use it in GitHub Desktop.
Save andreagrandi/9d749543888cc5c7b08c to your computer and use it in GitHub Desktop.
from microbit import *
while True:
reading = accelerometer.get_x()
if reading > 20:
display.show("R")
elif reading < -20:
display.show("L")
else:
display.show("-")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment