Temperature Gauge

Microbit & Servo

The micro:bit has a built-in temperature sensor that can detect the current temperature of the device, in degrees and Celsius. The temperature input, like the ambient light level, is stored under inputs in the block settings

First you need to learn how to use the on board temperature sensor

On Start
    set temp to 0    
    
    
On Shake
    set temp = current tempeature
    // the measure of the current tempature is the temperature(C) 
    scroll rounded temp

TIP: The temperature may be very different than the temperature in the room.

Since we can't throw our micro bits in the freezer or over a fire let us see if we an force some changes by holding it over the AC, cupping the microbit in your hand for a minute or walking into the hallway. Remember it is not really sensing the temperature of the air but of the actual microbit.

No convert the value stored in the temp variable from the current temperature reading in Celsius to Fahrenheit before you display temp

temp = (9/5) * temp + 32

Last updated