mirror of https://github.com/espruino/BangleApps
commit
3194228397
11
apps.json
11
apps.json
|
@ -361,5 +361,16 @@
|
|||
{"name":"-blescan","url":"blescan.js"},
|
||||
{"name":"*blescan","url":"blescan-icon.js", "evaluate":true}
|
||||
]
|
||||
},
|
||||
{ "id": "mmonday",
|
||||
"name": "Manic Monday Tone",
|
||||
"icon": "manic-monday-icon.png",
|
||||
"description": "The Bangles make a comeback",
|
||||
"tags": "sound",
|
||||
"storage": [
|
||||
{"name":"+mmonday","url":"manic-monday.json"},
|
||||
{"name":"-mmonday","url":"manic-monday.js"},
|
||||
{"name":"*mmonday","url":"manic-monday-icon.js","evaluate":true}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
require("heatshrink").decompress(atob("MDABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"))
|
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
|
@ -0,0 +1,46 @@
|
|||
// made using https://www.espruino.com/Making+Music
|
||||
// Manic Monday tone by The Bangles
|
||||
|
||||
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);
|
||||
|
||||
var pitches = {
|
||||
'G': 207.65,
|
||||
'a': 220.00,
|
||||
'b': 246.94,
|
||||
'c': 261.63,
|
||||
'd': 293.66,
|
||||
'e': 329.63,
|
||||
'f': 369.99,
|
||||
'g': 392.00,
|
||||
'A': 440.00,
|
||||
'B': 493.88,
|
||||
'C': 523.25,
|
||||
'D': 587.33,
|
||||
'E': 659.26,
|
||||
'F': 698.46
|
||||
};
|
||||
|
||||
function step() {
|
||||
var ch = tune[pos];
|
||||
if (ch !== undefined) pos++;
|
||||
if (ch in pitches) freq(pitches[ch]);
|
||||
else freq(0); // off
|
||||
}
|
||||
|
||||
var tune = "aggffefed";
|
||||
var pos = 0;
|
||||
|
||||
setWatch(() => {
|
||||
var playing = setInterval(step, 500);
|
||||
if(playing === 0) clearInterval(playing);
|
||||
}, BTN1);
|
||||
|
||||
E.showMessage('BTN1 to start', 'Manic Monday');
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"name":"Manic Monday tone",
|
||||
"icon": "*mmonday",
|
||||
"src":"-mmonday"
|
||||
}
|
Loading…
Reference in New Issue