Adafruit_Learning_System_Gu.../CircuitPython_Quick_Starts/CircuitPython_AnalogOut/code.py
2022-02-22 15:50:12 -05:00

16 lines
408 B
Python

# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT
# CircuitPython IO demo - analog output
import board
from analogio import AnalogOut
analog_out = AnalogOut(board.A0)
while True:
# Count up from 0 to 65535, with 64 increment
# which ends up corresponding to the DAC's 10-bit range
for i in range(0, 65535, 64):
analog_out.value = i