The On-board Crickit NeoPixel is great for providing status information to the user. It can also function as a light to help you find your bot in the dark.
This page will quickly show you how to use this NeoPixel.
MakeCode
You can use the three special NeoPixel blocks in the CRICKIT block group extension to change the single NeoPixel on-board Crickit. They work just like the NeoPixel blocks under the LIGHT block group but just for the one Crickit pixel.
You can independently set a color for the NeoPixel, turn it off, or set the brightness.
CircuitPython
The internal NeoPixel is on the Crickit's seesaw controller, pin #27. In addition to importing the adafruit_crickit
library you'll need the adafruit_seesaw.neopixel
library also. The code is below:
# SPDX-FileCopyrightText: 2018 Anne Barela for Adafruit Industries # # SPDX-License-Identifier: MIT # Using Crickit's onboard NeoPixel # See http://www.color-hex.com/ for more colors and find your fav! from adafruit_crickit import crickit from adafruit_seesaw.neopixel import NeoPixel crickit_status_pixel = NeoPixel(crickit.seesaw, 27, 1) # one NeoPixel pin 27 # Fill them with our favorite color "#0099FF light blue" -> 0x0099FF crickit_status_pixel.fill(0x0099FF) while True: pass
The fill
function will set the pixel to the hex code for red, green, and blue for the pixel. to turn the NeoPixel off, use a value of zero, such as crickit_status_pixel.fill(0x000000)
.
Page last edited January 21, 2025
Text editor powered by tinymce.