File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 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>
112112 >
113113 </ textarea >
114114 < div class ="actions ">
115+ < button id ="flash "> Flash</ button >
115116 < button id ="stop "> Stop</ button >
116117 < button id ="reset "> Reset</ button >
117118 < button id ="mute "> Mute</ button >
@@ -231,11 +232,7 @@ <h1>MicroPython-micro:bit simulator example embedding</h1>
231232 } ) ;
232233 fetchProgram ( sample . value ) ;
233234
234- document
235- . querySelector ( "#flash" )
236- . addEventListener ( "click" , async ( ) => { } ) ;
237-
238- document . querySelector ( "#stop" ) . addEventListener ( "click" , async ( ) => {
235+ document . querySelector ( "#flash" ) . addEventListener ( "click" , async ( ) => {
239236 simulator . postMessage (
240237 {
241238 kind : "flash" ,
@@ -247,6 +244,15 @@ <h1>MicroPython-micro:bit simulator example embedding</h1>
247244 ) ;
248245 } ) ;
249246
247+ document . querySelector ( "#stop" ) . addEventListener ( "click" , async ( ) => {
248+ simulator . postMessage (
249+ {
250+ kind : "stop" ,
251+ } ,
252+ "*"
253+ ) ;
254+ } ) ;
255+
250256 document . querySelector ( "#reset" ) . addEventListener ( "click" , async ( ) => {
251257 simulator . postMessage (
252258 {
You can’t perform that action at this time.
0 commit comments