File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ <h1>MicroPython-micro:bit simulator example embedding</h1>
112
112
>
113
113
</ textarea >
114
114
< div class ="actions ">
115
+ < button id ="flash "> Flash</ button >
115
116
< button id ="stop "> Stop</ button >
116
117
< button id ="reset "> Reset</ button >
117
118
< button id ="mute "> Mute</ button >
@@ -231,11 +232,7 @@ <h1>MicroPython-micro:bit simulator example embedding</h1>
231
232
} ) ;
232
233
fetchProgram ( sample . value ) ;
233
234
234
- document
235
- . querySelector ( "#flash" )
236
- . addEventListener ( "click" , async ( ) => { } ) ;
237
-
238
- document . querySelector ( "#stop" ) . addEventListener ( "click" , async ( ) => {
235
+ document . querySelector ( "#flash" ) . addEventListener ( "click" , async ( ) => {
239
236
simulator . postMessage (
240
237
{
241
238
kind : "flash" ,
@@ -247,6 +244,15 @@ <h1>MicroPython-micro:bit simulator example embedding</h1>
247
244
) ;
248
245
} ) ;
249
246
247
+ document . querySelector ( "#stop" ) . addEventListener ( "click" , async ( ) => {
248
+ simulator . postMessage (
249
+ {
250
+ kind : "stop" ,
251
+ } ,
252
+ "*"
253
+ ) ;
254
+ } ) ;
255
+
250
256
document . querySelector ( "#reset" ) . addEventListener ( "click" , async ( ) => {
251
257
simulator . postMessage (
252
258
{
You can’t perform that action at this time.
0 commit comments