Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Commit 3cd8c59

Browse files
Merge pull request #250 from microsoft/dev
Update Staging for release
2 parents c0505c7 + 42d788f commit 3cd8c59

35 files changed

+1030
-787
lines changed

README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
# Device Simulator Express, a Microsoft Garage project
22

3+
<a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/Python-3.7%2B-blue.svg" alt="Python versions: 3.7+" /></a> <img src="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." /> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: We are using the MIT License"></a> <a href="CONTRIBUTING.md"><img src="https://img.shields.io/badge/PRs-Welcome-brightgreen.svg" alt="We are welcoming PRS!"></a> <img src="https://img.shields.io/badge/platform-win%20%7C%20osx-lightgrey.svg" alt="Platforms Supported: Windows, MacOSX"/>
4+
5+
<a href="https://microsoftgarage.visualstudio.com/002806e2-ebaa-4672-9d2e-5fe5d29154ef/_boards/board/t/227906bb-31ac-4b07-8626-3d757754a616/Microsoft.RequirementCategory/"><img src="https://microsoftgarage.visualstudio.com/002806e2-ebaa-4672-9d2e-5fe5d29154ef/227906bb-31ac-4b07-8626-3d757754a616/_apis/work/boardbadge/73f82653-3da1-4a6f-bb79-c91c9eecec28" alt="Azure DevOps Board Badge" /></a>
6+
37
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
48
result when you plug in your actual microcontroller. Curious about the output of the device, the serial
59
monitor allows you to observe the device output.
610

711
<img alt='CircuitPlayground Express' src=https://raw.githubusercontent.com/microsoft/vscode-python-devicesimulator/dev/assets/readmeFiles/cpx.jpg>
812

13+
## Build Status
14+
15+
| Branch | Build Status |
16+
| :------ | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
17+
| dev | [![Build Status](https://microsoftgarage.visualstudio.com/Intern%20GitHub/_apis/build/status/Adafruit/Pacifica-CI?branchName=dev)](https://microsoftgarage.visualstudio.com/Intern%20GitHub/_build/latest?definitionId=304&branchName=dev) |
18+
| staging | [![Build Status](https://microsoftgarage.visualstudio.com/Intern%20GitHub/_apis/build/status/Adafruit/Pacifica-CI?branchName=staging)](https://microsoftgarage.visualstudio.com/Intern%20GitHub/_build/latest?definitionId=304&branchName=staging) |
19+
| master | [![Build Status](https://microsoftgarage.visualstudio.com/Intern%20GitHub/_apis/build/status/Adafruit/Pacifica-CI?branchName=master)](https://microsoftgarage.visualstudio.com/Intern%20GitHub/_build/latest?definitionId=304&branchName=master) |
20+
921

1022
## Prerequisites
1123

@@ -89,7 +101,6 @@ Before deploying the python code to your CPX device, you need to format your dev
89101

90102
1. Download the firmware with the .uf2 file (link: https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-quickstart)
91103
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)).
93104

94105
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`
95106

@@ -98,7 +109,7 @@ Then, if you are on Windows, you will also need to install the Python Pywin32 pa
98109
#### 5. Use the Serial Monitor for your Adafruit CPX device (available on Windows and Mac only)
99110

100111
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"`
102113
3. Select your baud rate for the serial port
103114
4. The print() statements in your code will show in the output console
104115

@@ -123,11 +134,11 @@ Device Simulator Express provides several commands in the Command Palette (F1 or
123134
- `Device Simulator Express: [Circuit Playground Express] New File`: Opens an unsaved .py file with template code, also opens the simulator.
124135
- `Device Simulator Express: [Circuit Playground Express] Open Simulator`: Opens the simulator in the webView
125136
- `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.
131142

132143
### Keybindings
133144

@@ -148,6 +159,8 @@ In Device Simulator Express, you can use keyboard to interact with the device:
148159
- IntelliSense and syntax highlighting for micro:bit code
149160
- Template file generation
150161
- Integrated Python Debugging for the Simulator
162+
- Deploy MicroPython code to the physical device
163+
- Serial monitor (available on Windows and Mac only)
151164
- Simulation of the micro:bit device, including:
152165
- 25 LEDs
153166
- Light sensor
@@ -240,4 +253,3 @@ A `ThirdPartyNotices.txt` file is provided in the extension's source code listin
240253

241254
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.
242255
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.

ThirdPartyNotices.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5829,6 +5829,26 @@ The above copyright notice and this permission notice shall be included in all c
58295829
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.
58305830

58315831

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
5839+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
5840+
the Software, and to permit persons to whom the Software is furnished to do so,
5841+
subject to the following conditions:
5842+
5843+
The above copyright notice and this permission notice shall be included in all
5844+
copies or substantial portions of the Software.
5845+
5846+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5847+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
5848+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
5849+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
5850+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
5851+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
58325852
-------------------------------------------------------------------
58335853

58345854
-------------------------------------------------------------------

docs/how-to-use.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ Commands are accessible through :
99

1010
- **Open Simulator** : opens the webview of the simulator.
1111

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.
1313
_(**Note :** will open the simulator webview if it's not open yet)_.
1414

1515
- **Run Simulator** : runs the code you have opened in the simulator (make sure you've clicked on a valid code file).
1616
_(**Note :** will open the simulator webview if it's not open yet)_.
1717

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)_.
2020

2121
* **Select Serial Port** : selects the serial port of the board you want the serial monitor to interact with. (2)
2222
_(**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
8282
- The first time you install the extension, you'll need to execute the `run` command at least once in order to access auto-completion.
8383
- 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.
8484
- 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`.
8686
- 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.
8787

8888
### Notes

gulpfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const pythonToMove = [
3939
"./src/microbit/!(test)/**/*",
4040
"./src/*.py",
4141
"./src/common/*.py",
42+
"./src/dev-requirements.txt",
4243
"./src/requirements.txt",
4344
"./src/templates/*.*"
4445
];

locales/en/out/constants.i18n.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
"dialogResponses.readInstall": "Read installation docs",
1313
"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.",
1414
"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.",
1915
"error.noDevice": "No plugged in boards detected. Please double check if your board is connected and/or properly formatted",
2016
"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",
2117
"error.noFolderCreated": "In order to use the Serial Monitor, you need to open a folder and reload VS Code.",

locales/en/package.i18n.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22
"deviceSimulatorExpressExtension.commands.common.installDependencies": "Install Extension Dependencies",
33
"deviceSimulatorExpressExtension.commands.common.label": "Device Simulator Express",
44
"deviceSimulatorExpressExtension.commands.common.runSimulator": "Run Simulator",
5-
"deviceSimulatorExpressExtension.commands.cpx.changeBaudRate": "[Circuit Playground Express] Change Baud Rate",
6-
"deviceSimulatorExpressExtension.commands.cpx.closeSerialMonitor": "[Circuit Playground Express] Close Serial Monitor",
7-
"deviceSimulatorExpressExtension.commands.cpx.openSerialMonitor": "[Circuit Playground Express] Open Serial Monitor",
5+
"deviceSimulatorExpressExtension.commands.common.changeBaudRate": "Change Baud Rate",
6+
"deviceSimulatorExpressExtension.commands.common.closeSerialMonitor": "Close Serial Monitor",
7+
"deviceSimulatorExpressExtension.commands.common.openSerialMonitor": "Open Serial Monitor",
8+
"deviceSimulatorExpressExtension.commands.common.selectSerialPort": "Select Serial Port",
89
"deviceSimulatorExpressExtension.commands.cpx.openSimulator": "[Circuit Playground Express] Open Simulator",
910
"deviceSimulatorExpressExtension.commands.cpx.newFile": "[Circuit Playground Express] New File",
1011
"deviceSimulatorExpressExtension.commands.cpx.deployToDevice": "[Circuit Playground Express] Deploy to Device",
11-
"deviceSimulatorExpressExtension.commands.cpx.selectSerialPort": "[Circuit Playground Express] Select Serial Port",
12+
"deviceSimulatorExpressExtension.commands.microbit.deployToDevice": "[micro:bit] Deploy to Device",
1213
"deviceSimulatorExpressExtension.commands.microbit.openSimulator": "[micro:bit] Open Simulator",
1314
"deviceSimulatorExpressExtension.commands.microbit.newFile": "[micro:bit] New File",
1415
"deviceSimulatorExpressExtension.configuration.title": "Device Simulator Express configuration",
1516
"deviceSimulatorExpressExtension.configuration.properties.configEnvOnChange": "When you change the Python interpreter, the Device Simulator Express will automatically configure itself for the required dependencies.",
1617
"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.",
1819
"deviceSimulatorExpressExtension.configuration.properties.previewMode": "Enable this to test out and play with the new micro:bit simulator!"
1920
}

0 commit comments

Comments
 (0)