Difference between revisions of "5 Gets the board temperature"
Line 4: | Line 4: | ||
So before the board starts to heat up, the initial temperature must be the ambient temperature, and then gradually become the board temperature. | So before the board starts to heat up, the initial temperature must be the ambient temperature, and then gradually become the board temperature. | ||
− | sample code | + | =sample code= |
from microbit import * | from microbit import * | ||
Line 12: | Line 12: | ||
print(temp) | print(temp) | ||
display.show(str(temp)) | display.show(str(temp)) | ||
+ | |||
+ | =testing effect= | ||
+ | |||
+ | ==Led panel display content== | ||
+ | |||
+ | [[File:Tem.gif]] | ||
+ | |||
+ | ==Print the data== | ||
+ | |||
+ | [[File:Tem2.png]] | ||
+ | |||
+ | The temperature measured | ||
+ | |||
+ | [[File:Tem1.jpg]] |
Revision as of 02:04, 18 February 2019
Contents
thermistor
This module allows you to get ambient temperature.Before using it, it is recommended to put the board under cooling before collecting, otherwise the reading temperature will deviate from the surrounding temperature, because the board will generate heat, so the most influential heat source around it is the temperature of the board itself, so the ambient temperature will become the temperature of the board.
So before the board starts to heat up, the initial temperature must be the ambient temperature, and then gradually become the board temperature.
sample code
from microbit import * while True: sleep(100) temp = temperature() # get temperature ℃ print(temp) display.show(str(temp))
testing effect
Led panel display content
Print the data
The temperature measured