audio test

master
Kristin Galvin 2020-01-19 20:39:58 -08:00
parent 0624498947
commit e949bfb3be
2 changed files with 3 additions and 3 deletions

View File

@ -267,7 +267,7 @@
{ "id": "stetho", { "id": "stetho",
"name": "Stethoscope", "name": "Stethoscope",
"icon": "stetho.png", "icon": "stetho.png",
"version":"0.0193", "version":"0.0194",
"description": "Hear your heart rate", "description": "Hear your heart rate",
"tags": "health", "tags": "health",
"storage": [ "storage": [

View File

@ -12,7 +12,7 @@ var SPEAKER_PIN = D18;
function freq(f) { function freq(f) {
console.log("frequency: ", f); console.log("frequency: ", f);
if (f===0) digitalWrite(SPEAKER_PIN, 0); if (f===0) digitalWrite(SPEAKER_PIN, 0);
else analogWrite(SPEAKER_PIN, 0.9, {freq: f}); else analogWrite(SPEAKER_PIN, 0.5, {freq: f});
} }
function readHRM() { function readHRM() {
@ -25,7 +25,7 @@ function readHRM() {
g.clearRect(0,100,239,239); g.clearRect(0,100,239,239);
g.moveTo(-100,0); g.moveTo(-100,0);
} }
let frequency = parseFloat(((170 - (a*960*4))*100) + 200); let frequency = parseFloat(((170 - (a*960*4))*60) + 200);
if(frequency > 0) freq(frequency); if(frequency > 0) freq(frequency);
g.setColor(1,1,1); g.setColor(1,1,1);