Students are able to understand the use of built-in sensors, namely temperature and light sensors.
Students are able to produce a bear project that uses a temperature or light sensor to trigger the production of light.
micro:bit has built-in sensors such as temperature sensors and light sensors.
The built-in temperature sensor can detect the temperature around micro:bit.
The temperature detected by the micro:bit temperature sensor is slightly higher than the actual ambient temperature.
Example code using a temperature sensor.
The temperature variable block can be found in the Input block drawer.
The LED on the micro:bit board can also act as a light sensor to detect light around it.
The light sensor value goes from 0 (very dark) to 255 (very bright).
Example code using a light sensor.
Light level blocks are also available in the Input block drawer.
Materials needed to follow this video:
micro: bit + USB wire + 2 LEDs +2 alligator clips + 1 100ohm resistor
Computer
Visit makecode.microbit.org
Plastic bottle + colored paper + cardboard
Transcript
Display the ambient temperature on the micro:bit board and turn on the LED on the bear's eye when the micro:bit board is in a dark environment
Modify the temperature and light sensor programs to make different events
👉CLICK HERE👈 to try it on makecode.
Ways to build code.
End product.
Project criteria:
Use inputs to trigger the production of light, sound, and movement.
Draw a flow chart for your project.
Moves the hand when its tail is touched.
Plays music when button A is pressed.
Displays light level value when button B is pressed.
Moves the body when the eating place is touched.
Lights up the LED eye when the environment is dark.
Plays music when buttons A and B are pressed.