3 designed to run of microcontrollers. » Runs within just 256k of code space and 16k of RAM. » CircuitPython is an education friendly Adafruit fork of MicroPython » Both are open source! @nnja
philosophy of "batteries included" -- having a rich and versatile standard library which is immediately available, without making the user download separate packages. This gives the Python language a head start in many projects.” PEP 206
- red, green, and blue. By combining the amount and intensity of these three colors (255 * 255 * 255) you can produce over 16 million color variations! image: randomnerdtutorials.com
a data + charge USB cable » See a CircuitPython drive? » on Mac OS in /Volumes/CIRCUITPY » Otherwise, install CircuitPython » Create or edit a code.py (or main.py) file in the root directory. » ! Your code reloads & runs instantly! @nnja
is pressed from adafruit_circuitplayground.express import cpx import time RED = (255, 0, 0) # 255 Red, 0 Green, 0 Blue GREEN = (0, 255, 0) # 0 Red, 255 Green, 0 Blue BLUE = (0, 0, 255) # 0 Red, 0 Green, 255 Blue cpx.pixels.brightness = 0.1 my_colors = [RED, GREEN, BLUE] color_pos = 0 while True: # Keep looping forever... cpx.pixels.fill(my_colors[color_pos]) if cpx.button_a or cpx.button_b: # Button A or B was pressed color_pos = (color_pos + 1) % len(my_colors) time.sleep(0.2) # Sleep, to make the button less sensitive
BLUE)] color_pos = 0 while True: # Keep looping forever... name, color = my_colors[color_pos] cpx.pixels.fill(color) if cpx.button_a or cpx.button_b: # Button A or B was pressed color_pos = (color_pos + 1) % len(my_colors) next_name, _ = my_colors[color_pos] print("Changing color from %s to %s" % (name, next_name)) time.sleep(0.2) # Sleep, to make the button less sensitive @nnja
To see print()s or errors, you need to receive output from the Circuit Playground Express by opening a connection to the serial console. » ! You won't see any output without it. @nnja
the terminal and screen program to connect to the serial console on the Circuit Playground Express. $ ls /dev/tty.* # Select the usbmodem $ screen /dev/tty.usbmodem141401 # yours will be different! To quit screen, press ctrl+a followed by k @nnja
power & programming) » from a computer, portable phone charger, or wall » battery packs (JST connector) » need minimum 3.5V DC. Power with 3 household AAA batteries + enclosure with correct connector.
warning: only for advanced users » small, lightweight, energy dense, fragile » needs special care! » don't heat, puncture, or bend » ! for kids w/o supervision » requires special charging
Demo covers majority of features, prints sensor readings, etc. » Flag you can set to turn the Circuit Playground Express into a piano ! using capacitive touch pads! ✨ @nnja