Skip to content

Commit

Permalink
Merge pull request #135 from eplusx/fix-134-stop-execution-command
Browse files Browse the repository at this point in the history
Fix #134, Support stopping execution with VSCode command
  • Loading branch information
paulober authored Oct 1, 2023
2 parents 0acc16e + c3525fd commit b8e7c17
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,19 @@ pin = Pin("LED", Pin.OUT)

print("LED starts flashing...")
while True:
pin.toggle()
sleep(1) # sleep 1sec
try:
pin.toggle()
sleep(1) # sleep 1sec
except KeyboardInterrupt:
break
pin.off()
print("Finished.")
```

- To run your program, run `> MicroPico > Run current file on Pico` in your Python file's tab. You can also use the status bar button "Run " at the bottom of VS Code window.

- To stop the execution of the currently running program, run `> MicroPico > Stop execution`. The "Stop" button at the status bar does the same.

---

## Extension Settings
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@
"enablement": "resourceScheme == pico && isFileSystemResource && resourceExtname == .py",
"category": "MicroPico"
},
{
"command": "micropico.universalStop",
"title": "Stop execution",
"category": "MicroPico"
},
{
"command": "micropico.runselection",
"title": "Run current selection on Pico",
Expand Down

0 comments on commit b8e7c17

Please sign in to comment.