microbit/main.py
2021-03-20 20:43:56 +01:00

19 lines
381 B
Python

from microbit import *
SENSITIVITY = 10
while True:
x = accelerometer.get_x()
y = accelerometer.get_y()
if x > SENSITIVITY and y > SENSITIVITY:
image = Image.ARROW_NE
elif x > SENSITIVITY and y < -SENSITIVITY:
image = Image.ARROW_SE
elif x > SENSITIVITY:
image = Image.ARROW_E
else:
image = None
display.show(image)