Posts

Showing posts from May, 2019

Neopixel rainbow

Image
Thanks to great work by Mark Swanson, neopixel support is now available for S4A! We needed a small upgrade to the S4A component library, AVR to give some timing functions, otherwise the work is all done in swift. You can see some great demo videos. Spurred on by this I decided to add some optional extra low level support for many basic classes of neopixels, to give developers two options how to get started. Here is an example of making a rainbow using the new "Fast iLED" components. https://www.youtube.com/watch?v=e3nqyxCACKA&feature=youtu.be And all this in just a few lines of simple Swift code! import AVR typealias IntegerLiteralType = UInt8   let ledPin = 4 let pixels = 60   var buffer = iLED_Setup_Buffered(pin: ledPin, count: pixels, hasWhiteChip: true)   func rainbow() {     let hueDeltaPerPixel = 255 / pixels     for i in 0..<pixels {         buffer[Int(i)] = iLEDFastMakeColor(hue: i &* hueDeltaPerPixel, saturation: 255, value: 255, whi