from machine import UART, Pin, I2C
import machine
import time
LM35_Sens_pin = 26
# Pico_temp_pin= 28
LM35_Sens = machine.ADC(LM35_Sens_pin)#object created for the LM35 sensor
# Pico_temp = machine.ADC(Pico_temp_pin)#object created for the pico temperature sensor
conversion_factor = 3.3/65535
print(LM35_Sens)
while True:
lm35_temp_voltage_raw = LM35_Sens.read_u16()*conversion_factor
# pico_temp_voltage_raw = Pico_temp.read_u16()* conversion_factor
# Converts ADC value back to voltage
print(lm35_temp_voltage_raw)
# pico_temperature = 27 - (pico_temp_voltage_raw - 0.706)/0.001721
lm35_temperature = lm35_temp_voltage_raw/(10.0 / 1000)
#F_temp = (C_temp*9/5) +32
print(lm35_temperature)
Average_temperature = lm35_temperature
#print(pico_temperature,lm35_temperature,Average_temperature)
print(Average_temperature)