-
Notifications
You must be signed in to change notification settings - Fork 7
Neopixels
Neopixels are strings of small, very bright, multicoloured (RGB) LEDs that are individually addressable using a fast, custom one wire protocol.
They can easily be programmed in Swift for Arduino using built in functions in the standard hardware library (the AVR
module).
For example, to write all the neopixels on a 20 neopixel string connected to pin 5 to show a dim red colour...
let iLEDPin = 5
pinMode(pin: iLEDPin, mode: OUTPUT)
iLEDFastSetup(pin: iLEDPin, pixelCount: 20, hasWhite: false, grbOrdered: true)
let dimRed = iLEDFastMakeColor(red: 10, green: 0, blue: 0, white: 0)
for _ in 1...20 {
iLEDFastWritePixel(color: dimRed)
}
// Latch so color is displayed
delay(microseconds: 6)
The original LEDs were made by World Semiconductor, in Shenzen, China and most are still made there. They came to fame sold by Adafruit, who call them "neopixels" and the name is widely used for all such LEDs. In the S4A documentation, we tend to use the term "intelligent LEDs" or "iLED", to reflect the fact that actually "neopixel" is a trademark of Adafruit, but most people will colloquially call them "neopixels".
Some simple projects...
TBA