mirror of
https://forge.apps.education.fr/blender-edutech/blender-edutech-tutoriels.git
synced 2024-01-27 09:42:33 +01:00
25 lines
846 B
Python
25 lines
846 B
Python
|
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)
|