What are the built-in sensors?
Returns a number representing the temperature of CPU, measured in degree Celcius.
Thermometer at Work
Putting heavy workload on micro:bit may result in large difference between the CPU and the ambient.
Senses the direction the micro:bit is facing.
Compass at Work
- When compass is ready:
- Returns a number between 0~360, measured in degrees.
- Number 0 representing North.
- When compass is not ready:
- Returns the number -1003.
- Calibration available as block "calibrate compass."
- Calibration should be performed away from metals.
Measure acceleration as a scale from -1023 (backward direction) to 1023 (forward direction).
Accelerometer at Work
Acceleration data can be used to implement the shake event.
Measure light level as a scale from 0 (dark) to 255 (bright).
Light Meter at Work
- First time using "light level":
- Returns "" (empty response).
- Activates the light sensing feature.
- After that:
- Returns a number between 0~255.
Measure magnetic force in a specific direction in microteslas.
Magnetometer at Work
The stronger the magnetic force, the brighter the LED.
See you in micro:bit Workshop Level 3 ...
- micro:bit Radio Transimission
- micro:bit and External Modules (Part 1)
- micro:bit MakeCode Packages