Example 1: accelerometer

Display on the Micro:bit an 'R' if the X component of the accelaration is > 400, 'L' if it is < -400, '-' otherwise. Then check the program by inclinating the card on both sides.

The python code

The equivalent block code

The hex file

 

 


Last modified: Friday, 12 November 2021, 1:00 PM