X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/blobdiff_plain/68ddeb18d3cf9b7e42b56d057f87fa4a12f049e8..refs/heads/use-pi5-pio-neopixel:/examples/analog_in.py diff --git a/examples/analog_in.py b/examples/analog_in.py index 076ed07..af936d1 100644 --- a/examples/analog_in.py +++ b/examples/analog_in.py @@ -1,12 +1,18 @@ +# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries +# +# SPDX-License-Identifier: MIT +"""Analog in demo""" import time import board from analogio import AnalogIn analog_in = AnalogIn(board.A1) + def get_voltage(pin): return (pin.value * 3.3) / 4096 + while True: print((get_voltage(analog_in),)) time.sleep(0.1)