
SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
lcd
.
clear()
What more?
We can combine thermistor and I2C LCD1602 to make a room temperature meter.
from
lcd1602
import
LCD
import
machine
import
utime
import
math
thermistor
=
machine
.
ADC(
28
)
lcd
=
LCD()
while
True
:
temperature_value
=
thermistor
.
read_u16()
Vr
=
3.3
*
float
(temperature_value)
/
65535
Rt
=
10000
*
Vr
/
(
3.3
-
Vr)
temp
=
1
/
(((math
.
log(Rt
/
10000
))
/
3950
)
+
(
1
/
(
273.15
+
25
)))
Cel
=
temp
-
273.15
#Fah = Cel * 1.8 + 32
#print ('Celsius: %.2f C
Fahrenheit: %.2f F' % (Cel, Fah))
#utime.sleep_ms(200)
string
=
" Temperature is
\n
"
+
str
(
'{:.2f}'
.
format(Cel))
+
" C"
lcd
.
message(string)
utime
.
sleep(
1
)
lcd
.
clear()
3.4. Projects
105
Содержание Thales Kit
Страница 1: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 Jimmy SunFounder Jun 04 2021 ...
Страница 2: ......
Страница 4: ...ii ...
Страница 6: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 2 CONTENTS ...
Страница 10: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 6 Chapter 1 Introduction to Raspberry Pi Pico ...
Страница 12: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 8 Chapter 2 What is Included in This Kit ...
Страница 13: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 2 1 Components List 2 1 Components List 9 ...
Страница 42: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 38 Chapter 2 What is Included in This Kit ...
Страница 140: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 136 Chapter 3 For MicroPython User ...
Страница 164: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 160 Chapter 4 For Arduino User ...