Hey Everyone. I’ve been working on a project which I wanted to share. This project is largely centered around my RGB effects library for Spark which allows you to do cool animations with your RGB LED on your Spark Core but it also provides a example web app for interacting with firmware on your core using the Spark Cloud and how to deploy firmware over the air using a web app.
RGBEffect LibraryA RGB effects library for Spark Core. Allows you to do easily perform different animations with your Spark Core's RGB LED.
SparkCore (OTA for Demoing)
- Navigate to The Demo Web App
- Follow the instructions to flash the latest demo firmware to your Spark Core over the air (OTA) and control it once it’s there.
SparkCore (for Development)
- Add RGBEffect.cpp & RGBEffect.h to your project
- Add a #include “RGBEffect.h” to the top of your main project file
- Look at the demos/usage below
UsageThis library is much more complicated than my original LEDEffect library, which this library is loosely based on. To use this library you must first define colors (sort of like a color palette) and then you can use those defined colors with different effects.
List of Available Effects
- off - turns the RGB LED off
- on - assigned a specified color to the RGB LED
- breath - smoothly fades between the different colors designed by the colorNumSequence which is an array of color numbers
- fade - similar to breath but when the end of the sequence is reached the first color is jumped to sharply. Can be used to create a near fading up or fading down effect
- blink - blinks the color sequence
Interacting with Colors
- setColor - used to associate a red, green, blue color to a specific color number
- swapColors - used to swap two colors in the palette