Micro:bit – Temperature Sensor
Use the Micro:bit’s onboard temperature sensor to record changes during flight.
Instructions
- In MakeCode, create a variable called temp.
- Read
input.temperature()every second and radio the value. - Display readings when on the ground.
Code
radio.setGroup(2)
basic.forever(function () {
let temp = input.temperature()
radio.sendValue("temp", temp)
basic.pause(1000)
})
radio.onReceivedValue(function (name, value) {
basic.showNumber(value)
})
Extension
Compare inside-rocket vs outside-rocket readings by running two devices simultaneously.
