diff --git a/README.md b/README.md index 0b9cd5057..bb9183b20 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Device Simulator Express, a Microsoft Garage project -Python versions: 3.7+ VS Code version 1.43 Project Status: Active – The project has reached a stable, usable state and is being actively developed. License: We are using the MIT License We are welcoming PRS! Platforms Supported: Windows, MacOSX +Python versions: 3.7+ VS Code version 1.43 Project Status: Active – The project has reached a stable, usable state and is being actively developed. License: We are using the MIT License We are welcoming PRS! Platforms Supported: Windows, MacOSX Azure DevOps Board Badge @@ -9,165 +9,174 @@ result when you plug in your actual microcontroller. Curious about the output of monitor allows you to observe the device output. ## Devices we support: -- [**Adafruit Circuit Playground Express (CPX)**](#adafruit-circuit-playground-express-cpx-simulator) - - [CircuitPlayground Express](#adafruit-circuit-playground-express-cpx-simulator) -- [**BBC micro:bit**](#bbc-microbit-simulator) - - [bbc micro:bit](#bbc-microbit-simulator) +- [**Adafruit Circuit Playground Express (CPX)**](#adafruit-circuit-playground-express-cpx-simulator) -- [**Adafruit CLUE**](#adafruit-clue-simulator) (hidden behind preview flag) - - [Adafruit CLUE](#adafruit-clue-simulator) -## Build Status + [CircuitPlayground Express](#adafruit-circuit-playground-express-cpx-simulator) + +- [**BBC micro:bit**](#bbc-microbit-simulator) -| Branch | Build Status | -| :------ | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | -| 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) | -| 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) | -| 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) | + [bbc micro:bit](#bbc-microbit-simulator) +- [**Adafruit CLUE**](#adafruit-clue-simulator) (hidden behind preview flag) + + [Adafruit CLUE](#adafruit-clue-simulator) + +## Build Status + +| Branch | Build Status | +| :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| 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) | +| 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) | +| 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) | ## Prerequisites The following dependencies are required to install before launching Device Simulator Express. 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+](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 Device Simulator Express. +- _**[Visual Studio Code](https://code.visualstudio.com/)**_ +- _**[Node](https://nodejs.org/en/download/)**_ +- _**[Python 3.7+](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 Device Simulator Express. ## Adafruit Circuit Playground Express (CPX) Simulator ### Features -- IntelliSense and syntax highlighting for CircuitPython code for the CPX 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 CPX 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 +- IntelliSense and syntax highlighting for CircuitPython code for the CPX 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 CPX 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 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 Device Simulator Express. 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! - - - ### 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](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries) + +- 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](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries) ### Keyboard Shortcuts + In Device Simulator Express, you can use keyboard to interact with the device: -- Push Button: A for Button A, B for Button B, C for Buttons A & B -- Capacitive Touch Sensor: Shift + 1 ~ 7 for GPIO pins A1 - A7 -- Slider Switch: Shift + S -- Refresh the simulator: Shift + R -- Run the simulator: Shift + F +- Push Button: A for Button A, B for Button B, C for Buttons A & B +- Capacitive Touch Sensor: Shift + 1 ~ 7 for GPIO pins A1 - A7 +- Slider Switch: Shift + S +- Refresh the simulator: Shift + R +- Run the simulator: Shift + F ## BBC micro:bit Simulator ### Features -- IntelliSense and syntax highlighting for MicroPython code for the micro:bit library -- Template file generation -- Integrated Python Debugging for the Simulator -- Deploy MicroPython code to the physical device -- Serial monitor (available on Windows and Mac only) -- Simulation of the micro:bit device, including: - - 25 LEDs - - Push Buttons A and B - - Light sensor - - Motion sensors - - Acceleration detection including gesture detection - - Temperature sensor + +- IntelliSense and syntax highlighting for MicroPython code for the micro:bit library +- Template file generation +- Integrated Python Debugging for the Simulator +- Deploy MicroPython code to the physical device +- Serial monitor (available on Windows and Mac only) +- Simulation of the micro:bit device, including: + - 25 LEDs + - Push Buttons A and B + - Light sensor + - Motion sensors + - Acceleration detection including gesture detection + - Temperature sensor ### Useful Links -- Tutorials and Example Code for BBC micro:bit: - - [MicroPython documentation](https://microbit-micropython.readthedocs.io/en/latest/) - - [BBC micro:bit examples on the official micro:bit website](https://microbit.org/projects/make-it-code-it/?filters=python) + +- Tutorials and Example Code for BBC micro:bit: + - [MicroPython documentation](https://microbit-micropython.readthedocs.io/en/latest/) + - [BBC micro:bit examples on the official micro:bit website](https://microbit.org/projects/make-it-code-it/?filters=python) ### Keyboard Shortcuts -- Push Button: A for Button A, B for Button B, C for Buttons A & B -- Refresh the simulator: Shift + R -- Run the simulator: Shift + F + +- Push Button: A for Button A, B for Button B, C for Buttons A & B +- Refresh the simulator: Shift + R +- Run the simulator: Shift + F ## Adafruit CLUE Simulator -NOTE: This simulator is hidden under the preview mode flag. See below on how to enable the preview mode flag. +NOTE: This simulator is hidden under the preview mode flag. See below on how to enable the preview mode flag. ### Features -- IntelliSense and syntax highlighting for CircuitPython code for the following drivers and libraries: - - `adafruit_clue` - - `adafruit_slideshow` - - `adafruit_display_shapes` - - `adafruit_display_text` - - `adafruit_bitmap_font` - - `adafruit_fancyled` - - `neopixel` - - `displayio` -- Template file generation -- Integrated Python Debugging for the Simulator -- Deploy CircuitPython code to the physical device -- Serial monitor (available on Windows and Mac only) -- Simulation of the CLUE device, including: - - 240x240 color screen - - Push Buttons A and B - - Sensors for: - - Temperature - - Light - - Color - - Acceleration - - Humidity - - Pressure - - Proximity - - Gestures - - Gyro - - Magnetic Field + +- IntelliSense and syntax highlighting for CircuitPython code for the following drivers and libraries: + - `adafruit_clue` + - `adafruit_slideshow` + - `adafruit_display_shapes` + - `adafruit_display_text` + - `adafruit_bitmap_font` + - `adafruit_fancyled` + - `neopixel` + - `displayio` +- Template file generation +- Integrated Python Debugging for the Simulator +- Deploy CircuitPython code to the physical device +- Serial monitor (available on Windows and Mac only) +- Simulation of the CLUE device, including: + - 240x240 color screen + - Push Buttons A and B + - Sensors for: + - Temperature + - Light + - Color + - Acceleration + - Humidity + - Pressure + - Proximity + - Gestures + - Gyro + - Magnetic Field ### Useful Links -- Tutorials and Example Code for Adafruit CLUE: - - [Adafruit CLUE Overview](https://learn.adafruit.com/adafruit-clue) - - [Adafruit CLUE Examples on GitHub](https://github.com/adafruit/Adafruit_CircuitPython_CLUE/tree/master/examples) + +- Tutorials and Example Code for Adafruit CLUE: + - [Adafruit CLUE Overview](https://learn.adafruit.com/adafruit-clue) + - [Adafruit CLUE Examples on GitHub](https://github.com/adafruit/Adafruit_CircuitPython_CLUE/tree/master/examples) ### Keyboard Shortcuts -- Push Button: A for Button A, B for Button B, C for Buttons A & B -- Refresh the simulator: Shift + R -- Run the simulator: Shift + F + +- Push Button: A for Button A, B for Button B, C for Buttons A & B +- Refresh the simulator: Shift + R +- Run the simulator: Shift + F ## How to enable preview flag + Currently, we have our Adafruit CLUE simulator hidden behind a preview flag and we want you to try it out! + ### I. Open settings + For Windows and Linux, you can use Ctrl + , or use `File -> Preferences -> Settings` in the top menu to navigate to settings. For Mac, you can use Cmd + , or use `Code -> Preferences -> Settings`. Adafruit CLUE ### II. Search for our preview flag and enable it! -In the top search bar, search for `DeviceSimulatorExpress.previewMode`. Then, check the checkbox for the setting that pops up when you serach. +In the top search bar, search for `DeviceSimulatorExpress.previewMode`. Then, check the checkbox for the setting that pops up when you serach. Adafruit CLUE @@ -178,14 +187,16 @@ To use Device Simulator Express, install the extension from the marketplace and To access many of the commands, you need to open the command palette. This can be done with Ctrl + Shift + P for Windows and Linux / Cmd + Shift + P for Mac. It can also be accessed from the toolbar by going to `View -> Command Palette`. ### I. Take a look at the "Device Simulator Express: Getting Started" Command. -1. Type in `"Device Simulator Express: Getting Started"` in the command palette (Ctrl + Shift + P / Cmd + Shift + P to open the command palette). + +1. Type in `"Device Simulator Express: Getting Started"` in the command palette (Ctrl + Shift + P / Cmd + Shift + P to open the command palette). 2. Choose the the device you want to play with from the dropdown. 3. Read, copy and learn some of the things you can do with the simulator! Getting Started ### II. Start with the "Device Simulator Express: New File" Command. -1. Type in `"Device Simulator Express: New File"` in the command palette (Ctrl + Shift + P / Cmd + Shift + P to open the command palette). + +1. Type in `"Device Simulator Express: New File"` in the command palette (Ctrl + Shift + P / Cmd + Shift + P to open the command palette). 2. Select the device you want to use. 3. Name and save your file somewhere, and we’re good to go! 4. Start with some examples: you can find examples files and tutorials inside the comments at the top of the file. @@ -208,12 +219,13 @@ To access many of the commands, you need to open the command palette. This can b Before deploying the Python code to your CPX device, you need to format your device by following these tutorials: -- *For the CPX*: - - Download the firmware with the .uf2 file (link: https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-quickstart). - - Download the lastest versions of the cpx libraries (link: https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries). +- _For the CPX_: -- *For the micro:bit*: - - Download the firmware with the .hex file (link: https://microbit.org/get-started/user-guide/firmware/). + - Download the firmware with the .uf2 file (link: https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-quickstart). + - Download the lastest versions of the cpx libraries (link: https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries). + +- _For the micro:bit_: + - Download the firmware with the .hex file (link: https://microbit.org/get-started/user-guide/firmware/). 1. Plug in your device (make sure it’s formatted properly already). 2. Run the command `"Device Simulator Express: Deploy to Device"`. @@ -236,17 +248,18 @@ Before deploying the Python code to your CPX device, you need to format your dev 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: -- `Device Simulator Express: Getting Started`: Opens a page in VS Code that helps users get started with the extension. Here, users can browse through code that they can use to play with the simulators. -- `Device Simulator Express: Run Simulator`: Runs Python code on the simulator. -- `Device Simulator Express: New File`: Opens an unsaved .py file with template code, also opens the simulator for the selected device. -- `Device Simulator Express: Open Simulator`: Opens the simulator in the simulator window for the selected device -- `Device Simulator Express: Deploy to Device`: Copies the current file to the selected device. -- `Device Simulator Express: Open Serial Monitor`: Opens the serial monitor in the integrated output window. -- `Device Simulator Express: Close Serial Monitor`: Stops the serial monitor and releases the serial port. -- `Device Simulator Express: Change Baud Rate`: Changes the baud rate of the selected serial port. For Adafruit CPX, the default baud rate is 115200. -- `Device Simulator Express: Select Serial Port`: Changes the current serial port. +- `Device Simulator Express: Getting Started`: Opens a page in VS Code that helps users get started with the extension. Here, users can browse through code that they can use to play with the simulators. +- `Device Simulator Express: Run Simulator`: Runs Python code on the simulator. +- `Device Simulator Express: New File`: Opens an unsaved .py file with template code, also opens the simulator for the selected device. +- `Device Simulator Express: Open Simulator`: Opens the simulator in the simulator window for the selected device +- `Device Simulator Express: Deploy to Device`: Copies the current file to the selected device. +- `Device Simulator Express: Open Serial Monitor`: Opens the serial monitor in the integrated output window. +- `Device Simulator Express: Close Serial Monitor`: Stops the serial monitor and releases the serial port. +- `Device Simulator Express: Change Baud Rate`: Changes the baud rate of the selected serial port. For Adafruit CPX, the default baud rate is 115200. +- `Device Simulator Express: Select Serial Port`: Changes the current serial port. ## Contribute + [See here for steps to run the extension locally.](https://github.com/microsoft/vscode-python-devicesimulator/blob/dev/docs/developers-setup.md) ## Provide feedback @@ -273,11 +286,12 @@ setting which you can learn more about at https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting. To disable telemetry, follow these steps: -1) Open **File** (Open **Code** on macOS) -2) Select **Preferences** -3) Select **Settings** -4) Search for `telemetry` -5) Uncheck the **Telemetry: Enable Telemetry** setting + +1. Open **File** (Open **Code** on macOS) +2. Select **Preferences** +3. Select **Settings** +4. Search for `telemetry` +5. Uncheck the **Telemetry: Enable Telemetry** setting ## Third Party Notice @@ -285,12 +299,12 @@ A `ThirdPartyNotices.txt` file is provided in the extension's source code listin ## 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 try to deploy to the CPX while it's plugged in but you still get an error saying it cannot find the board, make sure your device 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 `"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. -- When you are using the serial monitor, if you get some unusual error messages, unplug the device and reload the VS Code windows. +- 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 try to deploy to the CPX while it's plugged in but you still get an error saying it cannot find the board, make sure your device 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 `"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. +- When you are using the serial monitor, if you get some unusual error messages, unplug the device and reload the VS Code windows. ## License diff --git a/src/latest_release_note.ts b/src/latest_release_note.ts index a4e1ddabd..ba165ecba 100644 --- a/src/latest_release_note.ts +++ b/src/latest_release_note.ts @@ -1,67 +1,57 @@ -// TODO: find a better way of loading html into a string -export const LATEST_RELEASE_NOTE = `

Device Simulator Express Release Notes 👩🏾‍💻 👨🏾‍💻 (Feb. 27, 2020)

-

- Welcome to the first update to the Device Simulator Express! Please feel free to enable our feature flag in - Settings - (under the setting titled “deviceSimulatorExpress.previewMode” in the User settings). -

-

Changes

-

-

Fixes (enabled by default):

- -

New features (only available with feature flag enabled):

- -

-

Upcoming Improvements

- -
-

Happy Hacking! ✨✨🐍🐍🍰
-       - The Device Simulator Express Team

`; +// TODO: find a better way of loading html into a string +export const LATEST_RELEASE_NOTE = `

Device Simulator Express Release Notes ⌨️🐍💞 (April 15, 2020)

+

+

+ We're unveiling a new addition to our DSX family of microcontroller simulators! Please welcome the Adafruit + CLUE + simulator 💕🔍.
+ This change is hidden under a preview flag by default. See + here to learn how to enable + preview mode!
+

+

+ Also, support for BBC micro:bit simulation is now officially released! 💖✨ Previously, it was hidden + behind a + preview flag. +

+

+

Features:

+ +

Changes:

+ +

Fixes:

+ +

+

Keep being a coding champ 🤩🏆🙌,
+       - The Device Simulator Express Team

`;