Recently I wrote about the Adafruit Crickit, here is my first test project with it.
Why Adafruit Circuitpython?
The main appeal is Micro/Circuit Python, but it's not the only platform around. Why this particular setup?
- Unlike Arduino and Pi, this combination has a lot of "out of the box" features, such as sensors and addressable LEDs.
- The Crickit board has high power (not particularly high current) ability
- Adafruit's famous customer support and libraries
This test was simply to ensure the boards were working together.
Setting up the test script
The Circuit Playground requires the latest firmware to interact with the Crickit, which is simply a drag and drop after double-clicking reset.
Once the firmware is in place, you can either address the on board hardware, or (using i2C), address the Crickit.
Code
Here I am using the baked-in neopixel libary and the Crickit neopixel connector, and doing a regular blink routine on the first Signal pin.
from busio import I2C
import board
import time
import neopixel
pixels = neopixel.NeoPixel(board.A1, 40, brightness=1)
i2c = I2C(board.SCL, board.SDA)
ss = Seesaw(i2c)
ss.pin_mode(2, ss.OUTPUT)
while 1:
ss.digital_write(2, True)
pixels.fill((100,0,100))
time.sleep(1)
ss.digital_write(2, False)
pixels.fill((0,0,100))
time.sleep(1)
Again, running the code is as simple as saving to the USB-drive that appears, or drag and drop.
What's next?
The board has servo and motor ports, and capacative touch pins. I am sure I can come up with some fun ways to utlize those :)