Skip to content

Instantly share code, notes, and snippets.

@mr1337357
Created August 29, 2013 04:41
Show Gist options
  • Save mr1337357/6374346 to your computer and use it in GitHub Desktop.
Save mr1337357/6374346 to your computer and use it in GitHub Desktop.
#include <SPI.h>
typedef struct {
uint8_t r;
uint8_t g;
uint8_t b;
} LED;
LED leds[68];
void sendleds(RGB *data) {
int i;
for(i=0;i<68;i++) {
SPI.transfer(data[i].r);
SPI.transfer(data[i].g);
SPI.transfer(data[i].b);
}
delay(1);
}
void setup() {
SPI.begin();
}
void loop() {
//change colors
sendleds(leds);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment