From 4ab164b3737b96fbe39aeae2ab9119ed05f4bb84 Mon Sep 17 00:00:00 2001 From: Kristin Galvin Date: Sun, 19 Jan 2020 17:10:10 -0800 Subject: [PATCH] audio test --- apps/stetho/stetho.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/stetho/stetho.js b/apps/stetho/stetho.js index 84658e85f..c3c9ccff9 100644 --- a/apps/stetho/stetho.js +++ b/apps/stetho/stetho.js @@ -8,6 +8,16 @@ var lastHigh = getTime(); var hrmList = []; var hrm; +var SPEAKER_PIN = D18; +function freq(f) { + if (f===0) digitalWrite(SPEAKER_PIN, 0); + else analogWrite(SPEAKER_PIN, 0.5, {freq: f}); + } + freq(1000); + freq(1500); + freq(0); + + function readHRM() { var a = analogRead(D29); var h = getTime();