A LIBRARY: use to interface neopixel lights with MBED
Diff: neopixels_spi.h
- Revision:
- 0:22b6f7132818
diff -r 000000000000 -r 22b6f7132818 neopixels_spi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/neopixels_spi.h Tue May 12 14:32:12 2015 +0000 @@ -0,0 +1,17 @@ +#ifndef NEOPIXELS_SPI_H +#define NEOPIXELS_SPI_H +#include <string.h> +#include <stdio.h> +#include "mbed.h" +class neopixels_spi{ + public: + //function declarations + void setRGBStrip1(int r, int g, int b); //sets colour of a strip of 8 RGB Pixels on pin 5 + void setRGBStrip2(int r, int g, int b); //sets colour of a strip of 8 RGB Pixels on pin 11 + void setRGBPixels1(int colours[8][3]); //sets sequence of colours for a strip of 8 RGB Pixels on pin 5 + void setRGBPixels2(int colours[8][3]); //sets sequence of colours for a strip of 8 RGB Pixels on pin 11 + void spi_init(); //initializes SPI pin at correct bit length and bit rate + int * decimalToBinary(int n); //converts a decimal value between 0 and 255 to an 8 bit binary array of 0xF00 (0) and 0xFF0 (1) +}; + +#endif \ No newline at end of file