BBC micro:bit It is a pocket-sized computer 70 times smaller and 18 times faster than the original BBC Micro computers used in schools. It has 25 red LED lights that can flash messages and be used to create games. There are two programmable buttons that can be used to control games or pause and skip songs on a playlist.
It has an accelerometer so it can detect motion and knows when you're on the move. The built-in compass knows which direction you're heading in and it can use a low energy Bluetooth connection to interact with other devices and the Internet.
On this script i use the accelerometer as a level tool, it can be used to indicate how parallel (level) a surface is relative to the earth.
- main.py, contains the python version.
- main.ts, contains the javascript version.
Clone this repository and flash main.py or main.ts to your micro:bit.
Read more info about flash this code on https://support.microbit.org/support/solutions/articles/19000013986-how-do-i-transfer-my-code-onto-the-micro-bit-via-usb
Check this code on the simupator https://makecode.microbit.org/_bh8fHRTKDXXz