Help, how can I read temperature and humidity from a Raspberry Pi Pico development board? #450
Answered
by
pelikhan
sqxieshuai
asked this question in
Q&A
-
I'm a beginner, can someone help me please? |
Beta Was this translation helpful? Give feedback.
Answered by
pelikhan
Jun 9, 2023
Replies: 2 comments 3 replies
-
What sensor do you plan to use for temperature/humidity sensing? |
Beta Was this translation helpful? Give feedback.
0 replies
-
@pelikhan Thanks for your prompt response. The Pico board actually has a built-in temperature sensor. Here's an example of how to read values from this sensor using Python. from machine import ADC
import time
adc = machine.ADC(4)
while True:
ADC_voltage = adc.read_u16() * (3.3 / (65535))
temperature_celcius = 27 - (ADC_voltage - 0.706)/0.001721
temp_fahrenheit=32+(1.8*temperature_celcius)
print("Temperature: {}°C {}°F".format(temperature_celcius,temp_fahrenheit))
time.sleep_ms(500) how can I achieve similar functionality using DeviceScript? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use 'mcuTemperature' in the latest build.