micro:bit Workshop Level 2
- micro:bit Built-in Sensors
- Applications with Built-in Sensors
What are the built-in sensors?
Thermometer
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.
Compass
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.
Accelerometer
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.
Light Meter
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.
Magnetometer
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