Temperature Sensor
The Microbit has an onboard temperature sensor
Add a ‘forever’ loop
Add a variable, rename it temperature. Get this variable to measure temperature from the Microbit
Now it needs to show a number
This number needs to be the Temperature variable
Challenge
1. Add a message after the temperature e.g. ‘degrees Celcius’2. The temperature in Norway is approximately 10 degrees colder than here. Write a program
to display the temperature in Norway3. The temperature in Spain is approximately 5 degrees hotter than here. Write a program to
display the temperature in Spain4. The temperature in Daeth Valley, Califormia is approximately twice the temperature here.
Write a program to display the temperature in Death Valley5. Write a program using if statements so that if the temperature is above 25 then it says ‘It is
warm’, else it says ‘It is not hot’6. Write a program using if statements so that if the temperature is above 25 then it says ‘It is
hot’, if it is below 10 it says ‘It is cold’, else it says ‘It is warm’
Answers
Top Related