audio test
parent
4ab164b373
commit
c99d1d2be8
|
|
@ -13,12 +13,13 @@ function freq(f) {
|
||||||
if (f===0) digitalWrite(SPEAKER_PIN, 0);
|
if (f===0) digitalWrite(SPEAKER_PIN, 0);
|
||||||
else analogWrite(SPEAKER_PIN, 0.5, {freq: f});
|
else analogWrite(SPEAKER_PIN, 0.5, {freq: f});
|
||||||
}
|
}
|
||||||
freq(1000);
|
|
||||||
freq(1500);
|
|
||||||
freq(0);
|
|
||||||
|
|
||||||
|
|
||||||
function readHRM() {
|
function readHRM() {
|
||||||
|
freq(1000);
|
||||||
|
freq(1500);
|
||||||
|
freq(0);
|
||||||
var a = analogRead(D29);
|
var a = analogRead(D29);
|
||||||
var h = getTime();
|
var h = getTime();
|
||||||
min=Math.min(min*0.97+a*0.03,a);
|
min=Math.min(min*0.97+a*0.03,a);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue