We included some examples to get you started with using Jupyter Notebooks with the Circuit Playground Express since it has lots of inputs and outputs to play with as is.
jupyter notebook
Windows
First, ensure there are no Jupyter terminal windows open (use the Ctrl-C key in the window to close one if you have one open. We'll start a new copy of Jupyter:
Start Button -> Anaconda -> Anaconda Prompt
The Anaconda command terminal will open. we need to go where the files were unzipped:
You'll have the (base) C:\Users\yourusername> prompt.
Type the following:
cd Downloads\CPK\circuitpython_kernel-master
There type jupyter notebook
Load up the Example Folder
OK no matter what you're running, you should have a screen like the one below on your Anaconda prompt window and the same Jupyter screen below as the mac/linux users.
If you started this from the directory we were using earlier (circuitpython-kernel), you'll see an examples/ folder:
If you don't see this folder, click the upload button on the Notebook Dashboard
Navigate to the folder for circuitpython-kernel (or circuitpython-kernel-master) you cloned or downloaded earlier. Navigate to the examples folder. Then, click upload on the imported notebook on your dashboard.
Locate the CPX_Blinka.ipynb notebook but don't click it yet!
At this point, you'll want to plug in your board and verify it shows up as a mountable drive called CIRCUITPY
If you don't see the CIRCUITPY drive, install CircuitPython on your board.
Make sure your notebook is running the CircuitPython kernel by clicking change kernel -> CircuitPython:
When you launch notebooks using the CircuitPython-Kernel, it'll search the serial ports on your computer and connect to your Adafruit CircuitPython board.
The CPX_Blinka notebook should open. We're going to use the notebook and learn about Jupyter in the process.
The first cell should be highlighted. Each of these cells hold media (like pictures, equations, or rich text) or code, executable by your CircuitPython board. Click run in the toolbar or press shift+enter to run the cell:
As you go use the run command to move the cells, you should see the Circuit Playground's LED turn on when the cell containing cpx_led.value = True
is executed:
Congrats - you just ran your first Jupyter Notebook!
Want to try another example? Navigate to the Notebook Dashboard and navigate to the examples/ folder.
Next, we'll learn how to create our own Jupyter Notebook.
Open your terminal to view the errors from the kernel. If the problem persists, copy the output from the terminal and file an issue on the GitHub Repository for this project.
There's an issue with your serial connection which is preventing the kernel from opening a serial connection with your board. Make sure your drivers are installed correctly and the CircuitPython board is displayed as CIRCUITPY drive in file explorer.
Text editor powered by tinymce.