Using the Application

Serial Terminal

Once your Circuit Playground Express is connected and you've allowed the application permission to access it, you'll be left at the serial terminal. If your code.py has print() statements in it, then you should be able to see the output of those statements getting printed into the serial text box. 

You can use the CTRL buttons to interact with the Circuit Playground. Just like on the computer, CTRL-C will break out of your running code.py and enter the REPL waiting for you to send it statements. Also, just like on the computer, CTRL-D will break out of the REPL and go back to running code.py.

REPL Macros

This is a feature that is used in conjunction with the Serial Terminal. You can create and store macros on your Android device. Then you can enter the REPL on your Circuit Python board and run the macros with the press of a button. Your macro will get sent to the REPL one line at a time.

To get started, go ahead and enter the REPL and then press the macro icon. Use the + button to create a macro. You'll be prompted to enter a name. Once you've named the macro, you can use can use the edit button to add some code to it. When you're ready, use the run button to start sending the macro code into the REPL.

If you want one to get started with macros, here is a script I like to use to make a smiley face with the Circuit Playground Express board:

Download: file
from adafruit_circuitplayground.express import cpx
# set color here
color = (0,0,222)

# setup
pixels = cpx.pixels
pixels.brightness = 0.02
pixels.fill((0,0,0))
pixels.show()

# mouth
for i in range(0,5):
    pixels[i] = color


# eyes
pixels[6] = color
pixels[8] = color

Code Editor

Before you can access the code editor, you need to make sure that you are not in the REPL. The load button is going to try to open the REPL for you, and if you were already in the REPL, it will warn you. If you are ever unsure, you can always either 1) unplug and re-plug your board (it will always start in normal non-REPL mode) or 2) press the CTRL-D button (this is the shortcut key to break out of REPL).

If you are unsure, you can always press CTRL-D just to be safe. Even if you weren't already in the REPL, it won't do any harm. If you press CTRL-D a few times and nothing happens, then you are good to go.

To access the code editor, swipe your finger left to scoot the screen over to the next page on the right. 

Press the LOAD button. The application will enter REPL and use statements like f.read() to send back the contents of code.py. Once the loading is complete, the contents of code.py will get placed into the editor text for you to view and edit. If you'd like, you can swipe back to the terminal page during loading to view the progress, you should see the contents of your code.py file scrolling past in the terminal text box.

If you make edits to the code, you can press the SAVE button to save your changes back to the code.py file on the board. The saving progress will be shown along the top of the screen. You can also go back to the terminal page to see the progress during saving if you'd like.

Once the saving is complete, your board will still be left in the REPL waiting for another statement. Press the CTRL-D button to break out of REPL and run the newly saved code.py file.

You can use this pattern over and over to change and then test your code:

  1. Press CTRL-D
  2. Swipe over to Code Editor page
  3. Press LOAD
  4. Edit code
  5. Press SAVE
  6. Swipe back to Serial Terminal page
  7. Press CTRL-D
This guide was first published on Dec 18, 2018. It was last updated on Dec 18, 2018. This page (Using the Application) was last updated on Sep 16, 2019.