Microbit temperature in python

The BBC micro:bit does not have a dedicated temperature sensor. Instead, the temperature provided is actually the temperature of the silicon die on the main CPU.

So not a perfect measure of the temperature of a room but can be used a rough guide, you could also use this to monitor that your micro bit processor is not overheating

Code

[codesyntax lang=”python”]

from microbit import *

while True:
    sleep(5000)
    print(str(temperature())+" degrees C")

[/codesyntax]

Testing

28 degrees C
28 degrees C
28 degrees C
28 degrees C
28 degrees C
28 degrees C
28 degrees C
28 degrees C
28 degrees C
28 degrees C

Leave a Comment

This div height required for enabling the sticky sidebar
Ad Clicks : Ad Views : Ad Clicks : Ad Views :