import machine
import utime
sensor_pin = machine.ADC(machine.Pin(34)) # OUT pin connected to GPIO 34
sensor_pin.atten(machine.ADC.ATTN_11DB) # Configure ADC for full range
while True:
temp_value = sensor_pin.read() # Read analog value (0-4095)
real_temp = (temp_value / 4095) * 100 # Convert to temperature (0-100°C)
print(f"Sending Real Temperature: {real_temp:.2f}°C")
with open("/sensor_data.txt", "w") as file:
file.write(str(real_temp)) # Save sensor data (attacker will modify it)
utime.sleep(2) # Send every 2 seconds