Modifications

Sauter à la navigation Sauter à la recherche
Page créée avec « {{MicroPython-Hack-Prepare-NAV}} == Introduction == {{bloc-etroit|text=Here you will learn how to read the accelerometer and signal using LEDs states like tilt left and tilt... »
{{MicroPython-Hack-Prepare-NAV}}

== Introduction ==
{{bloc-etroit|text=Here you will learn how to read the accelerometer and signal using LEDs states like tilt left and tilt right.}}

== Utiliser l'accéléromètre ==
{{bloc-etroit|text=The pyboard has an accelerometer (a tiny mass on a tiny spring) that can be used to detect the angle of the board and motion. There is a different sensor for each of the x, y, z directions. To get the value of the accelerometer, create a pyb.Accel() object and then call the x() method.

<nowiki>>>> accel = pyb.Accel()
>>> accel.x()
7</nowiki>


{{MicroPython-Hack-Accelerometre-TRAILER}}
29 917

modifications

Menu de navigation