MicroBit Sensoren

The MicroBit has a few sensors built right into it that can be very useful, including buttons, an accelerometer, a light sensor, a compass, and a temperature sensor. They can all be accessed in the "input" palette and be used as ways to control outputs from the MicroBit or trigger events. This code, created below, will display the compass direction when button A is pressed, and will show the amount of light in the screen as a bar graph when button B is pressed. If you hover over the sensor, it will give you information about what values it reads.