2022-2023/1NSI/02_Programmation_Python_et_microbit/scripts/05_boutons.py
Bertrand Benjamin f8337b40ab
All checks were successful
continuous-integration/drone/push Build is passing
Feat: ajoute des exercices pour microbit
2022-09-15 11:00:20 +02:00

15 lines
312 B
Python

from microbit import *
import time
while True:
if button_a.is_pressed():
display.show(Image.HAPPY)
time.sleep(1)
display.clear()
elif button_b.is_pressed():
display.show(Image.SAD)
time.sleep(1)
display.clear()
else:
display.show(Image.HEART)