This repository was archived by the owner on Dec 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Updating ReadMe.md #145
Merged
Merged
Updating ReadMe.md #145
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
8d4083d
changing doc
4a7ce24
added app insight to doc
29f4c31
adding configuration section
f5d8652
fixed sound svg issue
2fd031e
adding config doc
bbb406e
removing unused line
6fdc6cd
updating important files
cb2c4a4
corrections
27fc50b
Update docs/developers-setup.md
FMounz c90842e
Update docs/developers-setup.md
FMounz 0f54fd5
Update docs/how-to-use.md
FMounz e5ef805
Update docs/developers-setup.md
FMounz ad531c2
Update docs/how-to-use.md
FMounz 5f0d843
Update docs/how-to-use.md
FMounz 6e37b3b
Update docs/how-to-use.md
FMounz 2b75da4
Update docs/how-to-use.md
FMounz f6d75fa
updated according to review
61d1293
Update docs/how-to-use.md
FMounz 17f21ea
Update docs/how-to-use.md
FMounz 877f8be
correcting typo
8079c93
soled typo
b28a154
put css back
499b232
adding .po file
99756aa
Merge branch 'dev' of https://github.com/microsoft/vscode-python-embe…
917f0f8
Merge branch 'dev' of https://github.com/microsoft/vscode-python-embe…
1892c02
Merge branch 'dev' of https://github.com/microsoft/vscode-python-embe…
8177bcf
merged with dev
b4c46d9
renamed adafruit class
c2f75ce
adding documentation
7d26a83
Merge branch 'dev' of https://github.com/microsoft/vscode-python-embe…
91b3ce8
Merge branch 'dev' into users/t-famoun/update-doc
7ed4440
Adding licence and link to give feedback in readme and correcting ins…
6831107
adding elemnt
15668c7
added quick links
987290d
updating troubleshooting
e886621
updated to original content
d1f2e50
removed locale
29865de
Update README.md
FMounz 947ca02
Update README.md
FMounz 86840e0
updating read me
a067c03
Update README.md
FMounz aa2297d
udating doc
dbb8a7d
adding infor on dependencies
a1f34ef
Merge branch 'users/t-famoun/update-doc' of https://github.com/micros…
13c8417
updating doc
d7da218
updated according to reviews
5081d6a
adding images
f28ffc7
added image
0f8b2b1
images on same line
0bb6331
changed to resized images
3d8f738
using smaller gifs
7da6b7c
updatind due to review
ba59ee7
added precision
1efbf3e
correcting grammar issues
6477d9f
solving grammar
d2fba6f
merged with dev
af548bc
Merge branch 'dev' into users/t-famoun/update-doc
FMounz c09765a
merged with dev
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,205 @@ | ||
# Project Pacifica | ||
|
||
This project is a VS Code extension for makers to write for their microcontrollers and provide them a simulator to test their code. | ||
This extension currently supports some features of the Adafruit Circuit Playground Express. | ||
Make without limit! Pacifica, a Microsoft Garage project, allows you to code in CircuitPython for your awesome | ||
Circuit Playground Express (CPX) projects! Test and debug your code on the device simulator and see the same | ||
result when you plug in your actual microcontroller. Curious about the output of the device, the serial | ||
monitor allows you to observe the device output. | ||
|
||
## Build Status | ||
 | ||
|
||
| Branch | Build Status | | ||
| :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | | ||
| dev | [](https://microsoftgarage.visualstudio.com/Intern%20GitHub/_build/latest?definitionId=304&branchName=dev) | | ||
| staging | [](https://microsoftgarage.visualstudio.com/Intern%20GitHub/_build/latest?definitionId=304&branchName=staging) | | ||
| master | [](https://microsoftgarage.visualstudio.com/Intern%20GitHub/_build/latest?definitionId=304&branchName=master) | | ||
## Features | ||
|
||
## Code of conduct | ||
- IntelliSense and syntax highlighting for CircuitPython code (only supports CPX Express library) | ||
- Template file generation | ||
- Integrated Python Debugging for the Simulator | ||
- Serial monitor (available on Windows and Mac only) | ||
- Output panel for the simulator | ||
- Deploy CircuitPython code to the physical device. | ||
- Simulation of the Adafruit Circuit Playground Express device, including: | ||
- Green LED | ||
- Red LED | ||
- Push Buttons A and B | ||
- Slider Switch | ||
- Speaker: Play .wav file | ||
- 10 NeoPixels | ||
- Light sensor | ||
- Motion sensors | ||
- Acceleration detection | ||
- Device shake detection | ||
- Temperature sensor | ||
- 7 Capacitive Touch sensors | ||
|
||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or | ||
contact [[email protected]](mailto:[email protected]) with any additional questions or comments. | ||
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**. | ||
The code related to these sensors can still run on the actual CPX board and be deployed using Pacifica. | ||
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! | ||
|
||
## Documentation | ||
## Prerequisites | ||
|
||
- [Installation instructions](/docs/install.md) | ||
- [How to use the Extension](/docs/how-to-use.md) | ||
- [Setup for developers](/docs/developers-setup.md) | ||
- [Contributing](CONTRIBUTING.md) | ||
The following dependencies are required to install before launching Pacifica. | ||
You will be prompted to install the Python dependencies during the first use. | ||
|
||
- _**[Visual Studio Code](https://code.visualstudio.com/)**_ | ||
- _**[Node](https://nodejs.org/en/download/)**_ | ||
- _**[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) | ||
- _**[Python VS Code extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)**_: This will be installed automatically from the marketplace when you install Pacifica. | ||
|
||
The following dependecies can be installed for you by the extension by clicking yes when you are prompted to. (2) | ||
|
||
- _**Playsound**_ | ||
install by typing the following commands in a console: `pip install playsound` | ||
|
||
- _**Pywin 32**_ | ||
install by typing the following commands in a console: `pip install pywin32` | ||
- _**Python-Socketio**_ | ||
install by typing the following commands in a console: `pip install python-socketio` | ||
- _**Requests**_ | ||
install by typing the following commands in a console: `pip install requests` | ||
- _**Application Insights**_ | ||
install by typing the following commands in a console: `pip install applicationinsights` | ||
|
||
## Useful Links | ||
|
||
- Tutorials and Example Code for Adafruit CPX: | ||
- Adafruit CPX library tutorial: (https://learn.adafruit.com/circuitpython-made-easy-on-circuit-playground-express/circuit-playground-express-library) | ||
- Adafruit CPX Examples on GitHub: (https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/tree/master/examples) | ||
- Adafruit CPX Guided Tour (Intro for the Hardware) (https://learn.adafruit.com/adafruit-circuit-playground-express/guided-tour) | ||
- Format Adafruit CPX device: | ||
- Tutorial for formatting Adafruit CPX for CircuitPython (https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython) | ||
- Download Firmware .uf2 file (https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-quickstart) | ||
- Download the latest version of the Adafruit CPX library (link: https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries) | ||
|
||
## How to use | ||
|
||
To use Pacifica, install the extension from the marketplace and reload VS Code. | ||
|
||
### 1. Start with the “New File” Command. | ||
|
||
1. Type in “Pacifica: New File” in the command palette(`CTRL+SHIFT+P`to open the command palette). | ||
 | ||
2. Name and save your file somewhere, and we’re good to go!(3) | ||
3. Start with some examples: you can find examples files and tutorials inside the comments, | ||
FMounz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
as well as in the notification pop up when you run the `“Pacifica: New File”` Command. | ||
|
||
 | ||
|
||
### 2. Start from an existing python file. | ||
|
||
1. Open the folder or your .py file in Visual Studio Code. | ||
2. Run `open Simulator` from the command palette or icon in the editor toolbar. | ||
FMounz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### 3. Run your code on the simulator . | ||
FMounz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
 | ||
|
||
- Run `Run Simulator` from the command palette or icon in the editor toolbar. | ||
- You can use the `Play` or `Refresh` button on the simulator webview. | ||
FMounz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### 4. Deploy your code to the physical device | ||
|
||
Before deploying the python code to your CPX device, you need to format your device following these tutorials: | ||
|
||
1. Download the firmware with the .uf2 file (link: https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-quickstart) | ||
2. Download the lastest version of the cpx library (link: https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries). | ||
**_Note:_** Make sure you name your file main.py or code.py: the device automatically runs the first file that is likely named. | ||
|
||
 | ||
|
||
### 5. Use the Serial Monitor for your Adafruit CPX device(available Windows and Mac only) | ||
|
||
1. Plug in your CPX device (make sure it’s formatted properly already) | ||
2. Run the command `Device Simulator Express: Open Serial Monitor` | ||
3. Select your baud rate for the serial port | ||
4. The print() statements in your code will show in the output console | ||
|
||
### 6. Use the sensors in the Pacifica Simulator | ||
|
||
Generating input for the sensors can be done by interacting directly with device on the webview | ||
or by using the toolbar. | ||
|
||
  | ||
|
||
- **Switch, push buttons and capacitive touch:** click directly on the corresponding element on the device or use the keybindings. | ||
- **Temperature sensor, Light sensor, acceleration:** click on the corresponding button in the toolbar and change the value using the slider or the input box attached to it. | ||
- **Shake detection:** go to the motion sensor section in the toolbar and click on the shake button. | ||
|
||
### 7. Debug your project on the simulator | ||
|
||
1. Add breakpoints in your code | ||
2. Press F5 to enter the debugging mode, and you can start debugging line by line! | ||
|
||
## Commands | ||
|
||
Pacifica provides several commands in the Command Palette (F1 or Ctrl + Shift + P/ Cmd + Shift + P for Mac OS) for working with \*.py files: | ||
|
||
- `Pacifica: New File`: Opens an unsaved .py file with template code, also open the simulator. | ||
- `Pacifica: Open Simulator`: Opens the simulator in the webView | ||
- `Pacifica: Run on Simulator`: Runs python code on the simulator | ||
- `Pacifica: Deploy to Board`: Copies & Pastes the code.py or main.py file to CIRCUITPY drive if detected a CPX is plugged in | ||
- `Pacifica: Open Serial Monitor`: Opens the serial monitor in the integrated output window. | ||
- `Pacifica: Close Serial Monitor`: Stops the serial monitor and releases the serial port. | ||
- `Pacifica: Change Baud Rate`: Changes the baud rate of the selected serial port. For Adafruit CPX, the default baud rate is 115200. | ||
- `Pacifica: Select Serial Port`: Changes the current serial port. | ||
|
||
## Keybindings | ||
|
||
In Pacifica, you can use keyboard to interact with the device: | ||
|
||
- Push Button `A & B: A B` | ||
- Capacitive Touch Sensor `A1 – A7: SHIFT + 1~7` | ||
- Slider Switch: `SHIFT + S` | ||
- Refresh the simulator: `SHIFT + R` | ||
|
||
## Provide feedback | ||
|
||
To report issues, provide feedback or requests, please use this link: [Provide Feedback](https://aka.ms/AA5xpxx). | ||
We would love to hear from you about your experience to keep improving our project. | ||
|
||
## Privacy and Telemetry Notice | ||
|
||
- [Data collection](PRIVACY.md) | ||
Our extension is collecting anonymous data about your usage of our features to help us improve our product. You can find the Privacy Notice here: [Data collection](PRIVACY.md), as well as instructions on how to turn it off. | ||
|
||
## Third Party Notice | ||
|
||
- [Third Party Notice](ThirdPartyNotices.txt) | ||
|
||
## Troubleshooting Tips | ||
|
||
- The first time you install the extension, you'll need to execute the `run` command at least once in order to access auto-completion. | ||
- 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. | ||
- To open the output panel again after closing it go to VS Code menu: `View->Output`. | ||
- If you have pylint enabled, it might underline the import of the adafruit_circuitplayground library, but it will work correctly. | ||
- 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`. | ||
- If you can't get the Simulator communication working while debugging, try to open your `Settings` and check the port used under `'Pacifica: Debugger Server Port'`. You can either change it (usually ports above 5000 should work) or try to free it, then start debugging again. | ||
- When you are using the serial monitor, if you get some unusual error messages, unplug the device and reload the VS Code windows. | ||
|
||
## License | ||
|
||
Project Pacifica | ||
|
||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
|
||
MIT License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
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. | ||
|
||
## Notes | ||
|
||
(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. | ||
(2) You can chose to see to see the prompt or not by changing the extension configirations. | ||
(3) To be able to run the file from your physical device, it should either be named code.py or main.py. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
(for example it could be found at : `c:\users\<...>\appdata\local\programs\python\python37\lib\site-packages\pip`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. line 12 may need to change to a different executable name, will keep you posted There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay |
||
- Run in a console `python -m pip install --upgrade pip` | ||
|
||
- Python Modules | ||
* Python Modules | ||
|
||
- **Note:** On extension activation you will be prompted asking if you want the modules to be automatically installed for you | ||
- Playsound | ||
|
@@ -31,9 +31,9 @@ | |
- Application Insights | ||
- Run the command in a console : `pip install applicationinsights` | ||
|
||
- VS Code | ||
* VS Code | ||
|
||
- Python extension for VS Code (download from VS Code market place) | ||
* Python extension for VS Code (download from VS Code market place) | ||
|
||
## Steps to Get Started Running the Extension in Debug Mode | ||
|
||
|
@@ -68,4 +68,4 @@ | |
- `components/` | ||
- `cpx/` and `Simulator.tsx` : contain the React components and objects to display and handle the simulator webview | ||
- `toolbar/` : contains the React components used in the toolbar and the modal. | ||
- `translation/en.json`: contains the constants that should be localized. To internationalize the extension you can add additional files with constants sharing the same id found in _en.json_, but with the translated value. | ||
- `translation/en.json`: contains the constants that should be localized. To internationalize the extension you can add additional files with constants sharing the same id found in _en.json_, but with the translated values. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,17 +17,16 @@ _Note: You need to install all the dependencies in order to use the extension._ | |
|
||
- [VS Code](https://code.visualstudio.com/Download) | ||
- [Node](https://nodejs.org/en/download/) | ||
- [Python 3.7.4 (or latest)](https://www.python.org/downloads/) | ||
- [Python 3.7.4](https://www.python.org/downloads/) | ||
- **Warning :** Make sure you've included `python` and `pip` to your `PATH` in your **environment variables**. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also may need to change |
||
_(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` in a terminal, the command is recognized.)_ | ||
- Python VS Code extension (downloaded from VS Code Marketplace) | ||
- [Python VS Code extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) | ||
- **Note:** This extension is installed automatically from the marketplace when you install our extension | ||
- Python Modules | ||
- **Note:** On extension activation you will be prompted asking if you want the modules to be automatically installed for you | ||
- **Note:** On extension activation you will be prompted asking if you want the modules to be automatically installed for you. | ||
- Playsound : `pip install playsound` | ||
- Pywin32 : | ||
- Pywin32 : `pip install pywin32` | ||
- **Note:** This is only needed for Windows computers | ||
- `pip install pywin32` | ||
- Python-Socketio : `pip install python-socketio` | ||
- Requests : `pip install requests` | ||
- Application Insights: `pip install applicationinsights` | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.