Ivan Yohuno / neopixels_spi
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers neopixels_spi.h Source File

neopixels_spi.h

00001 #ifndef NEOPIXELS_SPI_H
00002 #define NEOPIXELS_SPI_H
00003 #include <string.h>
00004 #include <stdio.h>
00005 #include "mbed.h"
00006 class neopixels_spi{
00007     public:
00008     //function declarations 
00009     void setRGBStrip1(int r, int g, int b); //sets colour of a strip of 8 RGB Pixels on pin 5
00010     void setRGBStrip2(int r, int g, int b); //sets colour of a strip of 8 RGB Pixels on pin 11
00011     void setRGBPixels1(int colours[8][3]); //sets sequence of colours for a strip of 8 RGB Pixels on pin 5
00012     void setRGBPixels2(int colours[8][3]); //sets sequence of colours for a strip of 8 RGB Pixels on pin 11
00013     void spi_init(); //initializes SPI pin at correct bit length and bit rate
00014     int * decimalToBinary(int n); //converts a decimal value between 0 and 255 to an 8 bit binary array of 0xF00 (0) and 0xFF0 (1)
00015 };
00016  
00017 #endif