Anish Ansari
Published © GPL3+

How to Read Temperature Using BBC Micro:bit

By the end of this project, you will be able to know how to read temperature using BBC micro:bit.

EasyFull instructions provided30 minutes339

Things used in this project

Hardware components

BBC micro:bit board
BBC micro:bit board
×1
Male/Male Jumper Wires
×1
AA Batteries
AA Batteries
×1

Software apps and online services

MakeCode
Microsoft MakeCode
mucode editor

Story

Read more

Code

Javascript code

JavaScript
let item = 0  
basic.forever(() => {  
    item = input.temperature()  
    basic.showNumber(item)  
})  

MicroPython Code

MicroPython
from microbit import *  
while True:  
   temp = temperature()  
   display.scroll(str(temp) + 'C')  
   sleep(500) 

Credits

Anish Ansari

Anish Ansari

8 projects • 12 followers
Azure and IoT
Contact

Comments

Add projectSign up / LoginAbout BBC micro:bit