Created
August 20, 2014 20:17
-
-
Save kingcoyote/e04302e652d67be786c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <xc.h> | |
#include <pic18.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include "ws2812.h" | |
// subsystem structs | |
ws2812_ptr led; | |
void main() { | |
led.r = 0; | |
led.g = 255; | |
led.b = 255; | |
while(1) { | |
CLRWDT(); | |
// timing on the WS2812B is very precise. turn off interrupts before talking | |
GIE = 0; while (GIE); | |
ws2812_send(&led); | |
GIE = 1; while (!GIE); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment