-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from caternuson/master
added pixel_order
- Loading branch information
Showing
3 changed files
with
62 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# This example shows how to create a single pixel with a specific color channel | ||
# order and blink it. | ||
# Most NeoPixels = neopixel.GRB or neopixel.GRBW | ||
# The 8mm Diffused NeoPixel (PID 1734) = neopixel.RGB | ||
import time | ||
import board | ||
import neopixel | ||
|
||
# Configure the setup | ||
PIXEL_PIN = board.D1 # pin that the NeoPixel is connected to | ||
ORDER = neopixel.RGB # pixel color channel order | ||
COLOR = (100, 50, 150) # color to blink | ||
CLEAR = (0, 0, 0) # clear (or second color) | ||
DELAY = 0.25 # blink rate in seconds | ||
|
||
# Create the NeoPixel object | ||
pixel = neopixel.NeoPixel(PIXEL_PIN, 1, pixel_order=ORDER) | ||
|
||
# Loop forever and blink the color | ||
while True: | ||
pixel[0] = COLOR | ||
time.sleep(DELAY) | ||
pixel[0] = CLEAR | ||
time.sleep(DELAY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters