I had really good results using the NeoDriver with the Le Potato single board computer. Below are the steps that I found worked the best. Every single board computer is different, and configurations often change over time, so consider this page more of a suggested reference. Hopefully these steps give you clues for working with your flavor of OrangeBananaOnionRockchipAllWinner Pi.
JP also followed these steps when he put together his demo for his Product Pick of the Week live show.
Image the SD Card
There are a few different disk images available for the Le Potato, but I used the Raspbian image since that is familar to a lot of folks who have dabbled with a Raspberry Pi before. If your board has a Raspbian/Raspberry Pi OS image available try it out since it may be a little friendlier when interfacing with Blinka.
Download the Raspbian image for sml-s905x from the distro server. Use etcher to image the sd card.
First Boot
The first boot is just like booting up Raspberry Pi OS on a Raspberry Pi. Follow the setup steps to create a local account, setup Wi-Fi and update the OS.
Enable I2C
Enter ls /dev/i2c-*
in the terminal to see the available I2C buses. Pins 3 and 5 are on bus AO and need to be enabled with a device tree overlay.
sudo ldto enable i2c-ao
ls -al /dev/i2c-*
Connect the NeoDriver to 3.3V, GND, SDA (pin 3) and SCL (pin 5) and perform an I2C scan.
sudo i2cdetect -y 2
You should see I2C address 0x60 appear in the scan. If you don't, try running i2cdetect
on 0
or 1
.
Unfortunately it seems like the device tree overlays do not remain enabled upon rebooting so I've had to run the ldto enable
command every time on boot. A bash script with the command could be created to have it execute on boot.
Python and Blinka
Use the terminal to install these dependencies for Python and Blinka.
sudo apt install python3-pip
sudo pip3 install --upgrade setuptools
sudo apt-get install libgpiod2 python3-libgpiod
pip3 install gpiod
pip3 install adafruit-blinka
Then run a test Python script to check that Blinka is running properly with GPIO and I2C.
import board import digitalio import busio print("Hello blinka!") # Try to great a Digital input pin = digitalio.DigitalInOut(board.P5) print("Digital IO ok!") # Try to create an I2C device i2c = busio.I2C(board.SCL, board.SDA) print("I2C ok!") print("done!")
If it runs successfully then that means Blinka is all set. Next are the libraries for using the NeoDriver.
pip3 install adafruit-circuitpython-seesaw
pip3 install adafruit-extended-bus
The default busio I2C bus for Blinka doesn't seem to match-up with the GPIO I2C buses on Le Potato. Luckily there's the extended bus library that can let you pass the Linux bus ID.
NeoDriver Test
After the seesaw and extended bus libraries are installed, you can try running a NeoPixel test. Connect the NeoPixels to the NeoPixel output terminal block pins and connect a 5V power supply to the power input terminal block pins.
Then run this test code! It should be a rainbow swirl.
import time from rainbowio import colorwheel from adafruit_extended_bus import ExtendedI2C as I2C from adafruit_seesaw import seesaw, neopixel i2c = I2C(1, frequency = 800000) ss = seesaw.Seesaw(i2c, addr=0x60) neo_pin = 15 num_pixels = 30 pixels = neopixel.NeoPixel(ss, neo_pin, num_pixels, brightness = 0.3, auto_write=False) color_offset = 0 while True: for i in range(num_pixels): rc_index = (i * 256 // num_pixels) + color_offset pixels[i] = colorwheel(rc_index & 255) pixels.show() color_offset += 8 time.sleep(0.01)
Text editor powered by tinymce.