code.py
 1  # SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries
 2  #
 3  # SPDX-License-Identifier: MIT
 4  
 5  # Trinket IO demo - analog output
 6  
 7  import board
 8  from analogio import AnalogOut
 9  
10  aout = AnalogOut(board.D1)
11  
12  while True:
13      # Count up from 0 to 65535, with 64 increment
14      # which ends up corresponding to the DAC's 10-bit range
15      for i in range(0, 65535, 64):
16          aout.value = i