Image the SD Card
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 wifi 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
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. SPI isn't tested because we're just worried about GPIO and I2C for the purposes of the NeoDriver.
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 the potato. Luckily there's the extended bus library that can let you pass the Linux bus ID.
NeoDriver Test
After 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. It's set for 64 pixels because I was using the 8x8 NeoPixel matrix.
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)