6. Case 03: Thermometer#

6.1. Purpose#

Use the Smart Coding Kit to create a wearable thermometer.

6.3. Software#

MakeCodemakecode

6.4. Programming#

Step 1#

Create a variable flag. Initialize this variable to 0 when we startup our micro:bit.

../../_images/smart_coding_kit_case_03_02.png

Step 2#

Create a forever loop to show the variable i. If it is over the default value, it alarms; Or it does not alram.

../../_images/smart_coding_kit_case_03_03.png

Step 3#

When button A being pressed, set the returned value as i displaying on the micro:bit.

../../_images/smart_coding_kit_case_03_04.png

6.5. Result#

The current value will be detected and displayed on the micro:bit when button A being pressed.

6.6. Exploration#

6.7. FAQ#

Q: Sometimes the temperature is below 20 degrees, but the value detected is even higher?

A: The temperature detected is the micro:bit chips but not the environment, the chips will get hot obviously when powering on for a long time.

6.8. Relevant File#