Maria Jose
July 14, 2021

How to do the set up for Adafruit Circuit Playground Express (CPX) Simulator

How to do the set up for Adafruit Circuit Playground Express (CPX) Simulator

The official set up documentation can be visited in their official website


Installation

(see installation.md)

Important information: If you are running python 3.9 +, the device simulator express installation will not work correctly at least that you change de version of one dependency: pillow==7.0.0 to pillow==8.1 (See: website )

How to solve it? Modify the pillow version following the path and modify it in the requirement file: *Unix: .vscode/extensions/ms-python.devicesimulatorexpress-2020.0.36321/out/requirements.txt *Windows:.vscode\extensions\ms-python.devicesimulatorexpress-2020.0.36321\out\requirements.txt or use a previous version of python.

[warning tip]: If you have installed python2 in your system make sure it is not active as your default python command.

In some cases it is necessary to close it and open again (sometimes a couple of times).


Set up:

At that point, a screen will appear with the Device Simulator Express Installation.

If all goes OK, you would be able to don´t see any special screen.

Go to :

After click Device Simulator Express, you will need to wait some seconds until three options of simulators appear.

[Extra info]On these images the purple arrows are indicating different python working version.

Once the different options of simulators appear, we will select the CircuitPlayground Express and the simulator will appear.

After all these steps, we will arrive to the final screen divided in two. On the left, we have some information about a tutorial from the official documentation about CircuitPython and the coding area. On the right, on top we should see a microcontroller (CPX) image.


First steps:

Let´s start writing our first CircuitPython code to test that everything is OK.

#import CPX library 

from adafruit_circuitplayground import cp

while True:
    # start your code here
    cp.pixels.fill((0, 250, 0)) #add this line of code
    pass

-important: Remember save your file as code.py!!

Congrats! Your installation and set up is done, you are ready!

If you didn´t achieve it, don´t worry, go to the possible problems or review the installations and set-up steps.


Possible problems and how to solve them:

The first arrow shows that python2 is running, while on the bottom it looks like it is python 3.7+. Since the running version was python2.7 it was not working.

Follow and contact me