Adafruit_Learning_System_Gu.../Adafruit_AD8495_Guide/code.py
2021-10-21 15:19:24 -04:00

20 lines
387 B
Python
Executable file

# SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT
#
import time
import analogio
import board
ad8495 = analogio.AnalogIn(board.A1)
def get_voltage(pin):
return (pin.value * 3.3) / 65536
while True:
temperature = (get_voltage(ad8495) - 1.25) / 0.005
print(temperature)
print(get_voltage(ad8495))
time.sleep(0.5)