Python with the Adafruit Circuit Playground and Crickit

in #python6 years ago (edited)

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?

  1. Unlike Arduino and Pi, this combination has a lot of "out of the box" features, such as sensors and addressable LEDs.
  2. The Crickit board has high power (not particularly high current) ability
  3. 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 :)

Sort:  

I've really only ever used a raspberry pi. Do you just like this because of support and more built in libraries? Are there discrete cases for the set up?

Resteemed!

If I had to choose just one it would be the Pi because it’s a more capable board overall (being a full Linux computer), but this guy is more immediately accessible for doing fun “Arduino style” hardware/sensor/blinky light things :)

I guess that's true. I'm looking for a good board to pair with a raspberry pi as sensor boards. I want to use them to track and control things in my house and use the raspberry pi as a master control of sorts. I just don't want to run cables all over so I'm looking for a Bluetooth solution or something of the sort.

This should start a fun discussion. I am currently doing some remote monitoring using moteino boards from lowpowerlabs.com. They operate using RFM69 wireless in the 868/915mhz radio band. I have one with a USB interface connected to a Raspberry Pi that can communicate with remote nodes that are currently measuring temperatures with DS18B20 one-wire sensors.

That's great! How many devices can be recognized at once by the USB dongle?

The lowpower RFM69 code seem to allow 254 nodes (includes gateway). I am sure it mostly depends on amount of communication between nodes and gateway.

Thats not bad at all! It seems very achievable when most communication will only be intermittent signals to perform an action. thanks for the tip!

I pray that you can do more fun .. hard work will bring satisfactory results.

hopefully I can learn bit by bit the same sir, sorry because I was new in steemit, success is always a friend

Congratulations This post has been upvoted by SteemMakers. We are a community-based project that aims to support makers and DIYers on the blockchain in every way possible.

Join our Discord Channel to connect with us and nominate your own or somebody else's posts in our review channel.

Help us to reward you for making it ! Join our voting trail or delegate steem power to the community account.

Your post is also presented on the community website www.steemmakers.com where you can find other selected content.

If you like our work, please consider upvoting this comment to support the growth of our community. Thank you.