liveBook · Manning

NeoPixel

As explained in Build Your Own Robot: Using Python, CRICKIT, and Raspberry Pi

A NeoPixel is a digitally controllable RGB light-emitting diode whose color and brightness can be set by software.

A NeoPixel is a software-controlled RGB LED whose color and brightness provide immediate visual feedback for a robot. On the CRICKIT HAT, Python controls the onboard pixel through the Adafruit CRICKIT library. section 1.3.3 section 2.3

Multicolor blink

Save the blinking program as blink.py, activate the Python virtual environment, make the file executable with chmod a+x blink.py, and run it with ./blink.py. The program prints each color, displays it for 0.1 seconds, and continues until Ctrl+C stops it.

The CRICKIT HAT communicates with the Raspberry Pi through I2C using its onboard microcontroller; the Adafruit CRICKIT library handles that communication. An I2C scan identifies the connected device at address 0x49.

How Build Your Own Robot: Using Python, CRICKIT, and Raspberry Pi covers it

How deep it goes
Explains color, brightness, naming, blinking, execution, and briefly identifies the underlying I2C communication.
Examples
Uses blue output, named RGB colors, a blinking script, executable Unix commands, and an I2C device scan.
What it assumes
Assumes a Raspberry Pi with CRICKIT HAT, Python environment access, and a way to open a REPL or run scripts.
What you can do after
Operate the onboard LED through the Adafruit CRICKIT Python library and run a reusable multicolor blinking program.
How it connects
Connects NeoPixel control to Raspberry Pi, CRICKIT HAT, Python, RGB color codes, and I2C communication.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Your Own Robot: Using Python, CRICKIT, and Raspberry Pi. The section links point to the parts of the book it draws on.