Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetNetIf LPD8806 mbed
Fork of OSCReceiver by
Control.cpp
00001 #include "mbed.h" 00002 #include "LPD8806.h" 00003 #include "Control.h" 00004 00005 LPD8806 strip = LPD8806(30); 00006 00007 // setup 00008 void LedControl::setup(int numberOfLed) 00009 { 00010 // strip = LPD8806(numberOfLed); 00011 } 00012 00013 // led pattren------------------------------------------------------ 00014 00015 void LedControl::colorChase(int r, int g, int b, uint8_t delay) { 00016 int i; 00017 00018 for (i=0; i < strip.numPixels(); i++) { 00019 strip.setPixelColor(i, 0); // turn all pixels off 00020 } 00021 00022 for (i=0; i < strip.numPixels(); i++) { 00023 strip.setPixelColor(i, strip.Color(r,g,b)); 00024 if (i == 0) { 00025 strip.setPixelColor(strip.numPixels()-1, 0); 00026 } else { 00027 strip.setPixelColor(i-1, 0); 00028 } 00029 strip.show(); 00030 wait_ms(delay); 00031 } 00032 }
Generated on Mon Aug 1 2022 22:54:19 by
