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

Commit faabb51

Browse files
committed
Fix merge conflicts
2 parents 5ddb822 + 33ad456 commit faabb51

File tree

16 files changed

+191
-139
lines changed

16 files changed

+191
-139
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# At least one of the code owners below will be required on each PR:
22

3-
* @markAtMicrosoft @smmatte @adclements @abmahdy @LukeSlev @iennae
3+
* @markAtMicrosoft @smmatte @adclements @abmahdy @iennae @nasadigital @isadorasophia @sagarmanchanda

README.md

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Circuit Playground Express (CPX) projects! Test and debug your code on the devic
55
result when you plug in your actual microcontroller. Curious about the output of the device, the serial
66
monitor allows you to observe the device output.
77

8-
![CircuitPlayground Express](https://www.microsoft.com/en-us/garage/wp-content/uploads/sites/5/2019/08/cpx.jpg)
8+
<img alt='CircuitPlayground Express' src=https://raw.githubusercontent.com/microsoft/vscode-python-devicesimulator/dev/assets/readmeFiles/cpx.jpg>
99

1010
## Features
1111

@@ -29,7 +29,7 @@ monitor allows you to observe the device output.
2929
- Temperature sensor
3030
- 7 Capacitive Touch sensors
3131

32-
The simulator supports most of the sensors on CPX except **IR transmitter & Receiver**, **Sound Sensor (microphone)**, **Speaker (Play Tone)** and the **tap on Motion Sensor**.
32+
The simulator supports most of the sensors on CPX except **IR transmitter & Receiver**, **Sound Sensor (microphone)**, **Speaker (Play Tone)** and the **"tap" on Motion Sensor**.
3333
The code related to these sensors can still run on the actual CPX board and be deployed using Device Simulator Express.
3434
As we only support CPX library now, other libraries (i.e. simpleio) can’t run on the simulator. But they will work on the actual device!
3535

@@ -43,53 +43,49 @@ You will be prompted to install the Python dependencies during the first use.
4343
- _**[Python 3.7.4](https://www.python.org/downloads/)**_: Make sure you've added python and pip to your PATH in your environment variables. (1)
4444
- _**[Python VS Code extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)**_: This will be installed automatically from the marketplace when you install Device Simulator Express.
4545

46-
The following dependecies can be installed for you by the extension by clicking yes when you are prompted to (**except** `pywin32` which is needed only on Windows platform). (2)
46+
- Python Modules for Simulation
47+
- **Note:** On extension activation, you will be prompted with a popup message asking if you want the modules to be automatically installed for you. The following Python modules should be downloaded when you select "yes" on the prompt message. **If modules are not installed correctly, please use the "pip install" commands listed below.**
48+
- Playsound : `pip install playsound`
49+
- Pywin32 : `pip install pywin32`
50+
- On Windows, you need to use the above command in the console to manually install pywin32.
51+
- Python-Socketio : `pip install python-socketio`
52+
- Requests : `pip install requests`
53+
- Application Insights: `pip install applicationinsights`
4754

48-
- _**Playsound**_
49-
install by typing the following commands in a console: `pip install playsound`
50-
51-
- _**Pywin 32**_
52-
install by typing the following commands in a console (only for Windows computers, you must run it manually): `pip install pywin32`
53-
- _**Python-Socketio**_
54-
install by typing the following commands in a console: `pip install python-socketio`
55-
- _**Requests**_
56-
install by typing the following commands in a console: `pip install requests`
57-
- _**Application Insights**_
58-
install by typing the following commands in a console: `pip install applicationinsights`
5955

6056
## Useful Links
61-
6257
- Tutorials and Example Code for Adafruit CPX:
63-
- Adafruit CPX library tutorial: (https://learn.adafruit.com/circuitpython-made-easy-on-circuit-playground-express/circuit-playground-express-library)
64-
- Adafruit CPX Examples on GitHub: (https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/tree/master/examples)
65-
- Adafruit CPX Guided Tour (Intro for the Hardware) (https://learn.adafruit.com/adafruit-circuit-playground-express/guided-tour)
58+
- [Adafruit CPX library tutorial](https://learn.adafruit.com/circuitpython-made-easy-on-circuit-playground-express/circuit-playground-express-library)
59+
- [Adafruit CPX Examples on GitHub](https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/tree/master/examples)
60+
- [Adafruit CPX Guided Tour (Intro for the Hardware)](https://learn.adafruit.com/adafruit-circuit-playground-express/guided-tour)
6661
- Format Adafruit CPX device:
67-
- Tutorial for formatting Adafruit CPX for CircuitPython (https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython)
68-
- Download Firmware .uf2 file (https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-quickstart)
69-
- Download the latest version of the Adafruit CPX library (link: https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries)
62+
- [Tutorial for formatting Adafruit CPX for CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython)
63+
- [Download Firmware .uf2 file](https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-quickstart)
64+
- [Download the latest version of the Adafruit CPX library](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries)
65+
- For developers:
66+
- [Steps to run the extension locally](/docs/developers-setup.md)
7067

7168
## How to use
7269

7370
To use Device Simulator Express, install the extension from the marketplace and reload VS Code.
7471

75-
### 1. Start with the New File Command.
72+
### 1. Start with the "New File" Command.
7673

77-
1. Type in Device Simulator Express: New File” in the command palette(`CTRL+SHIFT+P`to open the command palette).
78-
!["New File" animation](https://www.microsoft.com/en-us/garage/wp-content/uploads/sites/5/2019/08/newFile.gif)
79-
2. Name and save your file somewhere, and we’re good to go!(3)
80-
3. Start with some examples: you can find examples files and tutorials inside the comments,
81-
as well as in the notification pop up when you run the `“Device Simulator Express: New File”` Command.
74+
1. Type in `"Device Simulator Express: New File"` in the command palette (`CTRL+SHIFT+P` to open the command palette).
75+
<img alt='"New File" animation' src=https://raw.githubusercontent.com/microsoft/vscode-python-devicesimulator/dev/assets/readmeFiles/newFile.gif>
76+
2. Name and save your file somewhere, and we’re good to go! (3)
77+
3. Start with some examples: you can find examples files and tutorials inside the comments, as well as in the notification pop up when you run the `"Device Simulator Express: New File"` Command.
8278

83-
![How to find example code screenshot](https://www.microsoft.com/en-us/garage/wp-content/uploads/sites/5/2019/08/findExamples.jpg)
79+
<img alt='How to find example code screenshot' src=https://raw.githubusercontent.com/microsoft/vscode-python-devicesimulator/dev/assets/readmeFiles/findExamples.jpg>
8480

8581
### 2. Start from an existing python file.
8682

8783
1. Open the folder or your .py file in Visual Studio Code.
8884
2. Run `open Simulator` from the command palette or icon in the editor toolbar.
8985

90-
### 3. Run your code on the simulator .
86+
### 3. Run your code on the simulator.
9187

92-
![How to run the simulator animation](https://www.microsoft.com/en-us/garage/wp-content/uploads/sites/5/2019/08/run.gif)
88+
<img alt='How to run the simulator animation' src='https://github.com/microsoft/vscode-python-devicesimulator/blob/dev/assets/readmeFiles/run.gif?raw=true'>
9389

9490
- Run `Run Simulator` from the command palette or icon in the editor toolbar.
9591
- You can use the `Play` or `Refresh` button on the simulator webview.
@@ -100,14 +96,16 @@ Before deploying the python code to your CPX device, you need to format your dev
10096

10197
1. Download the firmware with the .uf2 file (link: https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-quickstart)
10298
2. Download the lastest version of the cpx library (link: https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries).
103-
**_Note:_** Make sure you name your file main.py or code.py: the device automatically runs the first file that is likely named.
99+
**_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)).
100+
101+
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`
104102

105-
!["Deploy to Device" example](https://www.microsoft.com/en-us/garage/wp-content/uploads/sites/5/2019/08/deployToBoard.png)
103+
<img alt="Deploy to Device" src=https://raw.githubusercontent.com/microsoft/vscode-python-devicesimulator/dev/assets/readmeFiles/deployToBoard.png>
106104

107-
### 5. Use the Serial Monitor for your Adafruit CPX device(available Windows and Mac only)
105+
### 5. Use the Serial Monitor for your Adafruit CPX device (available on Windows and Mac only)
108106

109107
1. Plug in your CPX device (make sure it’s formatted properly already)
110-
2. Run the command `Device Simulator Express: Open Serial Monitor`
108+
2. Run the command `"Device Simulator Express: Open Serial Monitor"`
111109
3. Select your baud rate for the serial port
112110
4. The print() statements in your code will show in the output console
113111

@@ -129,7 +127,7 @@ or by using the toolbar.
129127

130128
Device Simulator Express provides several commands in the Command Palette (F1 or Ctrl + Shift + P/ Cmd + Shift + P for Mac OS) for working with \*.py files:
131129

132-
- `Device Simulator Express: New File`: Opens an unsaved .py file with template code, also open the simulator.
130+
- `Device Simulator Express: New File`: Opens an unsaved .py file with template code, also opens the simulator.
133131
- `Device Simulator Express: Open Simulator`: Opens the simulator in the webView
134132
- `Device Simulator Express: Run on Simulator`: Runs python code on the simulator
135133
- `Device Simulator Express: Deploy to Device`: Copies & Pastes the code.py or main.py file to CIRCUITPY drive if detected a CPX is plugged in
@@ -186,7 +184,7 @@ A `ThirdPartyNotices.txt` file is provided in the extension's source code listin
186184
- To open the output panel again after closing it go to VS Code menu: `View->Output`.
187185
- If you have pylint enabled, it might underline the import of the adafruit_circuitplayground library, but it will work correctly.
188186
- 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`.
189-
- If you can't get the Simulator communication working while debugging, try to open your `Settings` and check the port used under `'Device Simulator Express: Debugger Server Port'`. You can either change it (usually ports above 5000 should work) or try to free it, then start debugging again.
187+
- If you can't get the Simulator communication working while debugging, try to open your `Settings` and check the port used under `"Device Simulator Express: Debugger Server Port"`. You can either change it (usually ports above 5000 should work) or try to free it, then start debugging again.
190188
- When you are using the serial monitor, if you get some unusual error messages, unplug the device and reload the VS Code windows.
191189

192190
## License
@@ -217,6 +215,6 @@ A `ThirdPartyNotices.txt` file is provided in the extension's source code listin
217215

218216
## Notes
219217

220-
(1) Note: 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, but make sure that when you type _python_ in a terminal, the command is recognized and have the correct version.
221-
(2) You can chose to see to see the prompt or not by changing the extension configirations.
222-
(3) To be able to run the file from your physical device, it should either be named code.py or main.py.
218+
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.
219+
2. You can choose to see the prompt or not by changing the extension configurations.
220+
3. To be able to run the file on your physical device, it should either be named code.py or main.py.

docs/developers-setup.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,23 @@
1313
- **NOTE :** Make sure pip is added to your environment variables as well
1414
(for example it could be found at : `c:\users\<...>\appdata\local\programs\python\python37\lib\site-packages\pip`)
1515
- Run in a console `python -m pip install --upgrade pip`
16-
16+
1717
* Python Modules
18-
19-
- **Note:** On extension activation you will be prompted a popup asking if you want the modules to be automatically installed for you, **except** `pywin32` which is needed only on Windows platform.
20-
- Playsound
21-
- Run the command in a console : `pip install playsound`
22-
- pytest
23-
- Run the command in a console : `pip install pytest`
24-
- Pywin32
25-
- **Note:** This is only needed for Windows computers. You must install it manually with the above command!
26-
- Run the command in a console : `pip install pywin32`
27-
- Python-Socketio
28-
- Run the command in a console : `pip install python-socketio`
29-
- Requests
30-
- Run the command in a console : `pip install requests`
31-
- Application Insights
32-
- Run the command in a console : `pip install applicationinsights`
33-
18+
- **Note:** On extension activation, you will be prompted with a popup asking if you want the modules to be automatically installed for you. The following python modules should be downloaded when you select "yes" on the prompt message.
19+
- pywin32 **(on Windows only)**
20+
- On Windows, you need to use the following command in the console to manually install pywin32: `pip install pywin32`
21+
- *playsound*
22+
- *pytest*
23+
- *python-socketio*
24+
- *requests*
25+
- *applicationinsights*
26+
27+
*italics*: used in simulation mode only
3428
* VS Code
3529

3630
* Python extension for VS Code (download from VS Code market place)
3731

38-
## Steps to Get Started Running the Extension in Debug Mode
32+
## Steps to Get Started Running the Extension Locally
3933

4034
1. Make sure you have all the dependencies installed (Node, Python, Playsound, VS Code, Python VS Code extension)
4135

@@ -47,12 +41,12 @@
4741

4842
5. Run the command : `npm run compile`
4943

50-
6. Start debugging the extension by pressing F5 or going to VS Code Debug menu and select 'Start debugging'
44+
6. Start running the extension locally by pressing F5 or going to VS Code Debug menu and select 'Start debugging'
5145

5246
## Notes on how to use it
5347

5448
- [Documentation to use the Extension](/docs/how-to-use.md)
55-
- Debugging the extension opens a new VS Code window with the extension installed
49+
- Debugging the extension opens a new VS Code window with the local build of the extension
5650
- From the original VS Code window (opened in our repository) you can see outputs in the Debug Console
5751
- In the new VS Code window, you can access the commands provided by the extension from the Commands Palette (Ctrl+Shift+P)
5852
listed as 'Device Simulator Express : ...'

docs/how-to-use.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Commands are accessible through :
44

5-
- **The command palette** (`Ctrl+shift+P` or `View->Command Palette`) and type 'Device Simulator Express : `command_name`'
5+
- **The command palette** (`Ctrl+Shift+P` or `View->Command Palette`) and type 'Device Simulator Express : `command_name`'
66
- **The extension buttons** available on the top right of the Text Editor Panel when you have a Python file open (1)
77

88
## Available commands
@@ -12,11 +12,11 @@ Commands are accessible through :
1212
- **New File** : opens an unsaved file with links to help you and a code snippet that you can save as `code.py` / `main.py`.
1313
_(**Note :** will open the simulator webview if it's not open yet)_.
1414

15-
- **Run Simulator** : run the code you have open on the simulator (make sure you've clicked on a valid code file).
15+
- **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

1818
- **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 it's not the case : [Installing CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython))_.
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)_.
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.)_

docs/install.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,18 @@ _Note: You need to install all the dependencies in order to use the extension._
2222
_(Note: the easiest way to do it might be when you install Python, you can select the "Add to PATH" option directly. Otherwise you can search how to insert it manually, but make sure that when you type `python` (or `python3.7`) in a terminal, the command is recognized.)_
2323
- [Python VS Code extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
2424
- **Note:** This extension is installed automatically from the marketplace when you install our extension
25-
- Python Modules
26-
- **Note:** On extension activation you will be prompted a popup asking if you want the modules to be automatically installed for you, **except** `pywin32` which is needed only on Windows platform.
27-
- Playsound : `pip install playsound`
28-
- Pywin32 : `pip install pywin32`
29-
- **Note:** This is only needed for Windows computers. You must install it manually with the above command!
30-
- Python-Socketio : `pip install python-socketio`
31-
- Requests : `pip install requests`
32-
- Application Insights: `pip install applicationinsights`
25+
26+
* Python Modules
27+
- **Note:** On extension activation, you will be prompted with a popup asking if you want the modules to be automatically installed for you. The following python modules should be downloaded when you select "yes" on the prompt message. **If modules are not installed correctly, please use the "pip install" commands listed below.**
28+
- pywin32 **(on Windows only)**: `pip install pywin32`
29+
- On Windows, you need to use the above command in the console to manually install pywin32.
30+
- *playsound*: `pip install playsound`
31+
- *pytest*: `pip install pytest`
32+
- *python-socketio*: `pip install python-socketio`
33+
- *requests*: `pip install requests`
34+
- *applicationinsights*: `pip install applicationinsights`
3335

36+
*italics*: used in simulation mode only
3437
## How to use the Extension
3538

3639
- [How to use the Extension](/docs/how-to-use.md)

gulpfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const languages = [{ folderName: "en", id: "en" }];
2525
gulp.task("clean", () => {
2626
return del(
2727
[
28-
"out/!(python_libs)",
28+
"out/*",
2929
"package.nls.*.json",
3030
"../../dist/*0.0.0-UNTRACKEDVERSION.vsix"
3131
],
@@ -36,7 +36,7 @@ gulp.task("clean", () => {
3636
const pythonToMove = [
3737
"./src/adafruit_circuitplayground/*.*",
3838
"./src/*.py",
39-
"./src/requirements.txt"
39+
"./src/requirements.txt",
4040
];
4141

4242
gulp.task("python-compile", () => {

0 commit comments

Comments
 (0)