O'Reilly logo

Mastering Arduino by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Challenge

This will be one of the hardest challenges in the book. The Keyestudio NeoPixel shield has eight columns of pixels where each column contains five pixels where the pixels are numbered like this:

For the challenge, set each column to a different color and have the colors rotate from left to right across the shield. Here are a couple of hints to get you started. The first is the Adafruit NeoPixel library, which has a function named Color() that will return the 32-bit color based on the three red, green and blue values. Therefore, you can use the following code to convert an 8-bit number to the 32-bit color.

uint32_t colorNum(int color) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required