void StripController::init() { // Initialize the LED strip this->strip = LPD8806(LED_STRIP_LED_COUNT, LED_STRIP_PIN_DATA, LED_STRIP_PIN_CLOCK); // Begin the strip this->strip.begin(); // Clear the LED strip this->clear(); // Render the strip this->render(); // Play the initialization animation animationInit(); }
#include "MRF24J40.h" #include "led_patterns.h" #include "main.h" #ifndef TEST //extern "C" void mbed_reset(); //using namespace std; Serial pc(USBTX, USBRX); // Serial communication for debugging purposes LPD8806 strip = LPD8806(NUMLEDS); MRF24J40 mrf(p11,p12,p13,p14,p21); // pins for zig bee int grid_matrix[MAXROWS][MAXCOLS] = {0}; pixel_struct_t pixel_grid[PIXELROWS][PIXELCOLS] = {0}; // Used for sending and receiving char rxBuffer[256]; int rxLen; /*Extracts the individual strings and saves them into a vector*/ std::vector<std::string> split(const std::string &str, char delimiter, std::vector<std::string> extract) { std::stringstream ss(str); std::string item; while (std::getline(ss, item, delimiter)) { extract.push_back(item); } return extract;
#include "LPD8806.h" #include "SPI.h" #include "WProgram.h" int CheckForColors(); int nLEDs = 32; int dataPin = 2; int clockPin = 3; char rgb[32][3]; // nLEDs amount of R/G/B values [in decimal] int ret = 0; LPD8806 strip = LPD8806(nLEDs, dataPin, clockPin); //LPD8806 strip = LPD8806(nLEDs); // use hardware SPI - pins MUST be: clock = 11, data = 13 //**************************************************************************** void setup() { memset(rgb, 0, sizeof rgb); Serial.begin(9600); strip.begin(); strip.show(); } void loop() { ret = CheckForColors();