diff --git a/README.md b/README.md index 2f9aec0..675d36f 100755 --- a/README.md +++ b/README.md @@ -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 diff --git a/package.json b/package.json index 63853d7..852d0ea 100644 --- a/package.json +++ b/package.json @@ -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",