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.

BeginnerFull instructions provided30 minutes10,102

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

11 projects • 42 followers
Azure and IoT

Comments