![](/media/cache/profiles/01e5405ccd7d3efa1fd033aa7b7489e9.jpg.50x50_q85.jpg)
Simple demo for MultipinRGB lib.
Dependencies: MultipinRGB max32630fthr
Diff: main.cpp
- Revision:
- 1:e10e0ccddca1
- Parent:
- 0:8a5a157f2603
- Child:
- 2:6a33adb8bf65
--- a/main.cpp Tue Mar 28 20:28:33 2017 +0000 +++ b/main.cpp Tue Mar 28 23:36:03 2017 +0000 @@ -43,21 +43,17 @@ int main() { MultipinRGB leds(LED1, LED2, LED3); - float redDutyCycle(0.5F), grnDutyCycle(0.0F), bluDutyCycle(0.0F), temp; while(1) { - leds.writeRGB(redDutyCycle, grnDutyCycle, bluDutyCycle); - - printf("RGB Duty Cycles = %3.1f, %3.1f, %3.1f\r\n", - redDutyCycle, grnDutyCycle, bluDutyCycle); - - //shift r->g->b->r - temp = bluDutyCycle; - bluDutyCycle = grnDutyCycle; - grnDutyCycle = redDutyCycle; - redDutyCycle = temp; - + leds.toggleLed(MultipinRGB::Red); + wait(0.25); + leds.toggleLed(MultipinRGB::Red); + leds.toggleLed(MultipinRGB::Green); wait(0.25); + leds.toggleLed(MultipinRGB::Green); + leds.toggleLed(MultipinRGB::Blue); + wait(0.25); + leds.toggleLed(MultipinRGB::Blue); } } \ No newline at end of file