From e3ee29a257079959e3389a8e525a90fd362fea08 Mon Sep 17 00:00:00 2001 From: ladyada Date: Sat, 30 Sep 2017 13:13:29 -0400 Subject: [PATCH] analogout --- Introducing_Trinket_M0/Trinket_AnalogOut.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Introducing_Trinket_M0/Trinket_AnalogOut.py diff --git a/Introducing_Trinket_M0/Trinket_AnalogOut.py b/Introducing_Trinket_M0/Trinket_AnalogOut.py new file mode 100644 index 000000000..927eb0da0 --- /dev/null +++ b/Introducing_Trinket_M0/Trinket_AnalogOut.py @@ -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