simple RGB led library

Dependents:   m3Dpi MQTT-Thermostat-example Final_project_Tran Final_project_Tran ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers CycleEffect.cpp Source File

CycleEffect.cpp

00001 
00002 #include "CycleEffect.h"
00003 
00004 Color::Colors CycleEffect::COLORS[7] = {Color::RED, Color::GREEN, Color::BLUE, Color::CYAN, Color::MAGENTA, Color::YELLOW, Color::WHITE};
00005 
00006 CycleEffect::CycleEffect(RGB* led) : Effect(led)
00007 {
00008 }
00009 
00010 void CycleEffect::run()
00011 {
00012     index++;
00013     if(index >= 7) index = 0;
00014 
00015     led->setColor(COLORS[index]);
00016     wait (1.0 * speed);
00017 }