You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 23, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,23 @@
1
1
# Device Simulator Express, a Microsoft Garage project
2
2
3
+
<ahref="https://www.python.org/downloads/"><imgsrc="https://img.shields.io/badge/Python-3.7%2B-blue.svg"alt="Python versions: 3.7+" /></a> <imgsrc="https://www.repostatus.org/badges/latest/active.svg"alt="Project Status: Active – The project has reached a stable, usable state and is being actively developed." /> <ahref="LICENSE"><imgsrc="https://img.shields.io/badge/license-MIT-blue.svg"alt="License: We are using the MIT License"></a> <ahref="CONTRIBUTING.md"><imgsrc="https://img.shields.io/badge/PRs-Welcome-brightgreen.svg"alt="We are welcoming PRS!"></a> <imgsrc="https://img.shields.io/badge/platform-win%20%7C%20osx-lightgrey.svg"alt="Platforms Supported: Windows, MacOSX"/>
Make without limit! Device Simulator Express, a Microsoft Garage project, allows you to code microcontrollers without the hardware on hand! You can program your Circuit Playground Express (CPX) or your BBC micro:bit! Test and debug your code on the device simulator and see the same
4
8
result when you plug in your actual microcontroller. Curious about the output of the device, the serial
| dev |[](https://microsoftgarage.visualstudio.com/Intern%20GitHub/_build/latest?definitionId=304&branchName=dev)|
@@ -89,7 +101,6 @@ Before deploying the python code to your CPX device, you need to format your dev
89
101
90
102
1. Download the firmware with the .uf2 file (link: https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-quickstart)
91
103
2. Download the lastest version of the cpx library (link: https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries).
92
-
**_Note:_** Make sure you name your file `main.py` or `code.py`: the device automatically runs the first file that is likely named. This is the convention for CircuitPython ([source](https://learn.adafruit.com/welcome-to-circuitpython/creating-and-editing-code#naming-your-program-file-7-32)).
93
104
94
105
Then, if you are on Windows, you will also need to install the Python Pywin32 package. Use the following command in the console: `pip install pywin32`
95
106
@@ -98,7 +109,7 @@ Then, if you are on Windows, you will also need to install the Python Pywin32 pa
98
109
#### 5. Use the Serial Monitor for your Adafruit CPX device (available on Windows and Mac only)
99
110
100
111
1. Plug in your CPX device (make sure it’s formatted properly already)
101
-
2. Run the command `"Device Simulator Express: [Circuit Playground Express] Open Serial Monitor"`
112
+
2. Run the command `"Device Simulator Express: Open Serial Monitor"`
102
113
3. Select your baud rate for the serial port
103
114
4. The print() statements in your code will show in the output console
104
115
@@ -123,11 +134,11 @@ Device Simulator Express provides several commands in the Command Palette (F1 or
123
134
-`Device Simulator Express: [Circuit Playground Express] New File`: Opens an unsaved .py file with template code, also opens the simulator.
124
135
-`Device Simulator Express: [Circuit Playground Express] Open Simulator`: Opens the simulator in the webView
125
136
-`Device Simulator Express: [Circuit Playground Express] Run on Simulator`: Runs python code on the simulator
126
-
-`Device Simulator Express: [Circuit Playground Express] Deploy to Device`: Copies & Pastes the code.py or main.py file to CIRCUITPY drive if detected a CPX is plugged in
127
-
-`Device Simulator Express: [Circuit Playground Express] Open Serial Monitor`: Opens the serial monitor in the integrated output window.
128
-
-`Device Simulator Express: [Circuit Playground Express] Close Serial Monitor`: Stops the serial monitor and releases the serial port.
129
-
-`Device Simulator Express: [Circuit Playground Express] Change Baud Rate`: Changes the baud rate of the selected serial port. For Adafruit CPX, the default baud rate is 115200.
130
-
-`Device Simulator Express: [Circuit Playground Express] Select Serial Port`: Changes the current serial port.
137
+
-`Device Simulator Express: [Circuit Playground Express] Deploy to Device`: Copies & Pastes the current file to CIRCUITPY drive if detected a CPX is plugged in
138
+
-`Device Simulator Express: Open Serial Monitor`: Opens the serial monitor in the integrated output window.
139
+
-`Device Simulator Express: Close Serial Monitor`: Stops the serial monitor and releases the serial port.
140
+
-`Device Simulator Express: Change Baud Rate`: Changes the baud rate of the selected serial port. For Adafruit CPX and the BBC micro:bit, the default baud rate is 115200.
141
+
-`Device Simulator Express: Select Serial Port`: Changes the current serial port.
131
142
132
143
### Keybindings
133
144
@@ -148,6 +159,8 @@ In Device Simulator Express, you can use keyboard to interact with the device:
148
159
- IntelliSense and syntax highlighting for micro:bit code
149
160
- Template file generation
150
161
- Integrated Python Debugging for the Simulator
162
+
- Deploy MicroPython code to the physical device
163
+
- Serial monitor (available on Windows and Mac only)
151
164
- Simulation of the micro:bit device, including:
152
165
- 25 LEDs
153
166
- Light sensor
@@ -240,4 +253,3 @@ A `ThirdPartyNotices.txt` file is provided in the extension's source code listin
240
253
241
254
1. Make sure that when you type _python_ in a terminal, the command is recognized and you have the correct version. The easiest way to do it is to select the "Add to PATH" option directly when you install Python. Otherwise you can search how to insert it manually.
242
255
2. You can choose to see the prompt or not by changing the extension configurations.
243
-
3. To be able to run the file on your physical device, it should either be named code.py or main.py.
Copy file name to clipboardExpand all lines: ThirdPartyNotices.txt
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5829,6 +5829,26 @@ The above copyright notice and this permission notice shall be included in all c
5829
5829
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5830
5830
5831
5831
5832
+
uflash
5833
+
The MIT License (MIT)
5834
+
Copyright (c) 2015-2018 Nicholas H.Tollervey and others.
5835
+
5836
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
5837
+
this software and associated documentation files (the "Software"), to deal in
5838
+
the Software without restriction, including without limitation the rights to
Copy file name to clipboardExpand all lines: docs/how-to-use.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,14 +9,14 @@ Commands are accessible through :
9
9
10
10
-**Open Simulator** : opens the webview of the simulator.
11
11
12
-
-**New File** : opens an unsaved file with links to help you and a code snippet that you can save as `code.py` / `main.py`.
12
+
-**New File** : opens an unsaved file to help you and a code snippet that you can save and play around with.
13
13
_(**Note :** will open the simulator webview if it's not open yet)_.
14
14
15
15
-**Run Simulator** : runs the code you have opened in the simulator (make sure you've clicked on a valid code file).
16
16
_(**Note :** will open the simulator webview if it's not open yet)_.
17
17
18
-
-**Deploy to Device** : saves the code to a Circuit Playground Express.
19
-
_(**Note :** the board needs to be correctly formatted to a `CIRCUITPY` drive first. If that's not the case check [Installing CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython) to correctly format it)_.
18
+
-**Deploy to Device** : saves the code to the connected device.
19
+
_(**Note :**For the Circuit Playground Express, the board needs to be correctly formatted to a `CIRCUITPY` drive first. If that's not the case check [Installing CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython) to correctly format it)_.
20
20
21
21
***Select Serial Port** : selects the serial port of the board you want the serial monitor to interact with. (2)
22
22
_(**Note :** USB detection must be enabled in the extension settings.)_
@@ -82,7 +82,7 @@ Here are the settings you can change in the Device Simulator Express configurati
82
82
- The first time you install the extension, you'll need to execute the `run` command at least once in order to access auto-completion.
83
83
- While running a code file, if you get an error saying it can't find the file, make sure you've clicked on a valid Python code file before running it.
84
84
- To open the output panel again after closing it go to VS Code menu : `View->Output`.
85
-
-If you try to deploy to the device while it's plugged in but you still get an error saying it cannot find the board, make sure your Circuit Playground Express is formatted correctly and that its name matches `CIRCUITPY`.
85
+
-For the Circuit Playground Express, if you try to deploy to the device while it's plugged in but you still get an error saying it cannot find the board, make sure your Circuit Playground Express is formatted correctly and that its name matches `CIRCUITPY`.
86
86
- If you can't get the Simulator communication working while debugging, try to open you `Settings` and check the port used under `'Device Simulator Express: Debugger Server Port'`. You can either change it (usually ports above 5000 could work) or try to free it, then start debugging again.
"error.debuggerServerInitFailed": "Warning : The Debugger Server cannot be opened. Please try to free the port {0} if it's already in use or select another one in your Settings 'Device Simulator Express: Debugger Server Port' and start another debug session.\n You can still debug your code but you won't be able to use the Simulator.",
14
14
"error.debuggingSessionInProgress": "[ERROR] A debugging session is currently in progress, please stop it before running your code. \n",
15
-
"error.incorrectFileNameForDevice": "[ERROR] Can\\'t deploy to your Circuit Playground Express device, please rename your file to \"code.py\" or \"main.py\". \n",
16
-
"error.incorrectFileNameForDevicePopup": "Seems like you have a different file name than what the CPX requires, please rename it to \"code.py\" or \"main.py\".",
17
-
"error.incorrectFileNameForSimulatorPopup": "We want your code to work on your actual board as well. Make sure you name your file \"code.py\" or \"main.py\" to be able to run your code on an actual physical device.",
18
-
"error.invalidFileNameDebug": "The file you tried to debug isn\\'t named \"code.py\" or \"main.py\\. Rename your file if you want your code to work on your actual device.",
19
15
"error.noDevice": "No plugged in boards detected. Please double check if your board is connected and/or properly formatted",
20
16
"error.noFileToRun": "\n[ERROR] We can't find the .py file to run on simulator. Open up a new .py file, or browse through some examples\n",
21
17
"error.noFolderCreated": "In order to use the Serial Monitor, you need to open a folder and reload VS Code.",
"deviceSimulatorExpressExtension.configuration.properties.configEnvOnChange": "When you change the Python interpreter, the Device Simulator Express will automatically configure itself for the required dependencies.",
16
17
"deviceSimulatorExpressExtension.configuration.properties.debuggerPort": "The port the Server will listen on for communication with the debugger.",
17
-
"deviceSimulatorExpressExtension.configuration.properties.dependencyChecker": "Whether or not to ask if we can download dependencies. If unchecked, the extension will default to never download dependencies, except when automatically creating a virtual environment in the extension files."
18
+
"deviceSimulatorExpressExtension.configuration.properties.dependencyChecker": "Whether or not to ask if we can download dependencies. If unchecked, the extension will default to never download dependencies, except when automatically creating a virtual environment in the extension files.",
18
19
"deviceSimulatorExpressExtension.configuration.properties.previewMode": "Enable this to test out and play with the new micro:bit simulator!"
0 commit comments