Adafruit_Learning_System_Gu.../MetroX_CircuitPython/mib_potentiometer_pwm/code.py
2022-02-22 13:45:02 -05:00

20 lines
374 B
Python
Executable file

# SPDX-FileCopyrightText: 2021 Brent Rubell for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
'mib_potentiometer_pwm.py'.
=================================================
fades a led using a potentiometer
"""
import analogio
import board
import pwmio
led = pwmio.PWMOut(board.D9)
pot = analogio.AnalogIn(board.A0)
while True:
led.duty_cycle = pot.value