25 lines
846 B
Python
Raw Normal View History

2023-05-14 06:17:15 +02:00
from microbit import *
###############################################################################
# 5-labyrinthe-microbit.py
# @title: Programme pour la carte micro:bit de gestion de la centrale inertielle
# @project: Blender-EduTech - Tutoriel 5 : Labyrinthe à bille - Interfacer avec une carte micro:bit
# @lang: fr
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
# @copyright: Copyright (C) 2023 Philippe Roy
# @license: GNU GPL
#
# Commandes déclenchées par UPBGE pour le scène du labyrinthe
#
###############################################################################
while True:
accel_x=accelerometer.get_x()
if accel_x < -30 :
display.show(Image.ARROW_W)
if accel_x > 30 :
display.show(Image.ARROW_E)
if accel_x > -30 and accel_x < 30 :
display.show(Image.YES)
sleep(100)