Device Simulator Express, a Microsoft Garage project
Please see the deprecation notice for details.
Make without limit! Device Simulator Express, a Microsoft Garage project, allows you to code microcontrollers without the hardware on hand! You can program your Adafruit Circuit Playground Express (CPX), your BBC micro:bit or the Adafruit CLUE! 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.
Branch | Build Status |
---|---|
dev | |
staging | |
master |
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.
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!
In Device Simulator Express, you can use keyboard to interact with the device:
adafruit_clue
adafruit_slideshow
adafruit_display_shapes
adafruit_display_text
adafruit_bitmap_font
adafruit_fancyled
neopixel
displayio
To use Device Simulator Express, install the extension from the marketplace and reload VS Code.
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
.
"Device Simulator Express: Getting Started"
in the command palette (Ctrl + Shift + P / Cmd + Shift + P to open the command palette)."Device Simulator Express: New File"
in the command palette (Ctrl + Shift + P / Cmd + Shift + P to open the command palette).Device Simulator Express: Open Simulator
from the command palette or icon in the editor toolbar.Run Simulator
from the command palette or use the Play
button on the simulator webview.Before deploying the Python code to your CPX device, you need to format your device by following these tutorials:
For the CPX:
For the micro:bit:
For the CLUE:
"Device Simulator Express: Deploy to Device"
."Device Simulator Express: Open Serial Monitor"
.print()
statements in your code will show in the output console.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 deviceDevice 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.See here for steps to run the extension locally.
To add a review for our extension, please do so on the Visual Studio Marketplace
To report issues, provide feedback or requests, please use this link: Provide Feedback.
We would love to hear from you about your experience to keep improving our project.
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
The Microsoft Device Simulator Express Extension for Visual Studio Code collects usage
data and sends it to Microsoft to help improve our products and
services. Read our
privacy statement to
learn more. This extension respects the telemetry.enableTelemetry
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:
telemetry
A ThirdPartyNotices.txt
file is provided in the extension's source code listing the appropriate third-party notices.
run
command at least once in order to access auto-completion.View -> Output
.CIRCUITPY
.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.sudo apt-get install -y python3-venv
to allow for virtual environment creation.Device Simulator Express, a Microsoft Garage project
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.