> For the complete documentation index, see [llms.txt](https://computational-thinking-in-room11.gitbook.io/room-112-dhs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://computational-thinking-in-room11.gitbook.io/room-112-dhs/software-development/temperature-gauge.md).

# Temperature Gauge

Microbit & Servo

&#x20;The micro:bit has a built-in temperature sensor that can detect the current temperature of the device, in degrees and [Celsius](https://en.wikipedia.org/wiki/Celsius). The temperature input, like the ambient light level, is stored under inputs in the block settings&#x20;

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.&#x20;

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.

![](https://2507214486-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpUPSf3tCxHePJxNjfg%2F-LsSyH0IobbYegHbztA_%2F-LsT-_oFleH-lOvqjMDP%2Fimage.png?alt=media\&token=3b503562-7bdf-44bc-a336-601c5f4e0eab)

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
```
