Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-matt-hillsdon committed Nov 13, 2024
1 parent 4cdbd46 commit 6e0d558
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ <h1>MicroPython-micro:bit simulator example embedding</h1>
>
</textarea>
<div class="actions">
<button id="flash">Flash</button>
<button id="stop">Stop</button>
<button id="reset">Reset</button>
<button id="mute">Mute</button>
Expand Down Expand Up @@ -231,11 +232,7 @@ <h1>MicroPython-micro:bit simulator example embedding</h1>
});
fetchProgram(sample.value);

document
.querySelector("#flash")
.addEventListener("click", async () => {});

document.querySelector("#stop").addEventListener("click", async () => {
document.querySelector("#flash").addEventListener("click", async () => {
simulator.postMessage(
{
kind: "flash",
Expand All @@ -247,6 +244,15 @@ <h1>MicroPython-micro:bit simulator example embedding</h1>
);
});

document.querySelector("#stop").addEventListener("click", async () => {
simulator.postMessage(
{
kind: "stop",
},
"*"
);
});

document.querySelector("#reset").addEventListener("click", async () => {
simulator.postMessage(
{
Expand Down

0 comments on commit 6e0d558

Please sign in to comment.