analogout
This commit is contained in:
parent
a5880c1021
commit
e3ee29a257
1 changed files with 13 additions and 0 deletions
13
Introducing_Trinket_M0/Trinket_AnalogOut.py
Normal file
13
Introducing_Trinket_M0/Trinket_AnalogOut.py
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
# Trinket IO demo - analog output
|
||||||
|
|
||||||
|
from analogio import AnalogOut
|
||||||
|
import board
|
||||||
|
import time
|
||||||
|
|
||||||
|
aout = AnalogOut(board.D1)
|
||||||
|
|
||||||
|
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):
|
||||||
|
aout.value = i
|
||||||
Loading…
Reference in a new issue