From 696b15e4b703a76daeb655dc2a8687d5fc1158f0 Mon Sep 17 00:00:00 2001 From: Derek Jamison Date: Mon, 21 Oct 2024 18:46:50 -0600 Subject: [PATCH] Updated sample for new APIs. --- js/dac/dac.js | 53 ++++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/js/dac/dac.js b/js/dac/dac.js index c63877f..baeb1ce 100644 --- a/js/dac/dac.js +++ b/js/dac/dac.js @@ -1,36 +1,41 @@ +// See https://youtu.be/saIGmyrM_Wc for details, starting around 6:00. +// We create an R-2R ladder using data bits A7, A6, A4, B3, B2, C3 and GND. + +let eventLoop = require("event_loop"); let gpio = require("gpio"); -let pins = ["PA7", "PA6", "PA4", "PB3", "PB2", "PC3"]; -for (let i=0; i