[{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/185/original/IMG_8906.jpg?1695060573","metadata":{"caption":""}},{"element_type":"text","content":"\n  \n  \n  \n\u003ch2\u003eImage the SD Card\u003c/h2\u003e\n\u003cp\u003e\u003ca href=\"https://distro.libre.computer/ci/raspbian/11/\" target=\"_blank\"\u003eDownload the Raspbian image for sml-s905x\u003c/a\u003e from the distro server. Use \u003ca href=\"https://etcher.balena.io/\" target=\"_blank\"\u003eetcher\u003c/a\u003e to image the sd card.\u003c/p\u003e\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n\u003ch2\u003eFirst Boot\u003c/h2\u003e\n\u003cp\u003eThe 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.\u003c/p\u003e\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n\u003ch2\u003eEnable I2C\u003c/h2\u003e\n\u003cp\u003eEnter \u003ccode\u003els /dev/i2c-*\u003c/code\u003e 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.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"hljs language-bash\"\u003esudo ldto \u003cspan class=\"hljs-built_in\"\u003eenable\u003c/span\u003e i2c-ao\n\u003cspan class=\"hljs-built_in\"\u003els\u003c/span\u003e -al /dev/i2c-*\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eConnect the NeoDriver to 3.3V, GND, SDA (pin 3) and SCL (pin 5) and perform an I2C scan.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"hljs language-undefined\"\u003esudo i2cdetect -y 2\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eYou should see I2C address 0x60 appear in the scan. If you don't, try running \u003ccode\u003ei2cdetect\u003c/code\u003e on \u003ccode\u003e0\u003c/code\u003e or \u003ccode\u003e1\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eUnfortunately it seems like the device tree overlays do not remain enabled upon rebooting so I've had to run the \u003ccode\u003eldto enable\u003c/code\u003e command every time on boot. A bash script with the command could be created to have it execute on boot.\u003c/p\u003e\n\n\n\n","metadata":{}},{"element_type":"alert","content":"It seems that the dtoverlay needs to be enabled every time you reboot!","metadata":{"class":"element row-fluid alert-element build-alert alert-warning ui-sortable-handle","alert_type":"warning"}},{"element_type":"text","content":"\n  \n  \n  \n\u003ch2\u003ePython and Blinka\u003c/h2\u003e\n\u003cul\u003e\n\u003cli class=\"code\"\u003e\u003ccode\u003esudo apt install python3-pip\u003c/code\u003e\u003c/li\u003e\n\u003cli class=\"code\"\u003e\u003ccode\u003e\u003cspan\u003esudo pip3 install --upgrade setuptools\u003c/span\u003e\u003c/code\u003e\u003c/li\u003e\n\u003cli class=\"code\"\u003e\u003ccode\u003esudo apt-get install libgpiod2 python3-libgpiod\u003c/code\u003e\u003c/li\u003e\n\u003cli class=\"code\"\u003e\u003ccode\u003epip3 install gpiod\u003cspan\u003e\u003c/span\u003e\u003c/code\u003e\u003c/li\u003e\n\u003cli class=\"code\"\u003e\u003ccode\u003e\u003cspan\u003epip3 install adafruit-blinka\u003c/span\u003e\u003c/code\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThen 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.\u003c/p\u003e\n\n\n\n","metadata":{}},{"element_type":"code","content":"import board\nimport digitalio\nimport busio\n\nprint(\"Hello blinka!\")\n\n# Try to great a Digital input\npin = digitalio.DigitalInOut(board.P5)\nprint(\"Digital IO ok!\")\n\n# Try to create an I2C device\ni2c = busio.I2C(board.SCL, board.SDA)\nprint(\"I2C ok!\")\n\nprint(\"done!\")","metadata":{"language":"python","linenums":false}},{"element_type":"text","content":"\n  \n  \n  \n\u003cp\u003eIf it runs successfully then that means Blinka is all set. Next are the libraries for using the NeoDriver.\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ccode\u003epip3 install adafruit-circuitpython-seesaw\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003epip3 install adafruit-extended-bus\u003c/code\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe 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.\u003c/p\u003e\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n\u003ch2\u003eNeoDriver Test\u003c/h2\u003e\n\u003cp\u003eAfter 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. \u003c/p\u003e\n\u003cp\u003eThen run this test code! It should be a rainbow swirl. It's set for 64 pixels because I was using the 8x8 NeoPixel matrix.\u003c/p\u003e\n\n\n\n","metadata":{}},{"element_type":"code","content":"import time\nfrom rainbowio import colorwheel\nfrom adafruit_extended_bus import ExtendedI2C as I2C\nfrom adafruit_seesaw import seesaw, neopixel\n\ni2c = I2C(1, frequency = 800000)\nss = seesaw.Seesaw(i2c, addr=0x60)\nneo_pin = 15\nnum_pixels = 30\n\npixels = neopixel.NeoPixel(ss, neo_pin, num_pixels, brightness = 0.3, auto_write=False)\n\ncolor_offset = 0\n\nwhile True:\n    for i in range(num_pixels):\n        rc_index = (i * 256 // num_pixels) + color_offset\n        pixels[i] = colorwheel(rc_index \u0026 255)\n    pixels.show()\n    color_offset += 8\n    time.sleep(0.01)","metadata":{"language":"python","linenums":false}}]