Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define INPUT_SIZE 6
- void loop() {
- if(Serial.available()) {
- char input[INPUT_SIZE];
- Serial.readBytes(input, INPUT_SIZE);
- long colorcode = (long) strtol(input, NULL, 16);
- color[0] = colorcode >> 16;
- color[1] = colorcode >> 8 & 0xFF;
- color[2] = colorcode & 0xFF;
- setColor(color);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment