updated
Fork of neopixels_spi by
neopixels_spi.h@0:22b6f7132818, 2015-05-12 (annotated)
- Committer:
- ivanyohuno
- Date:
- Tue May 12 14:32:12 2015 +0000
- Revision:
- 0:22b6f7132818
Created NeoPixels library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ivanyohuno | 0:22b6f7132818 | 1 | #ifndef NEOPIXELS_SPI_H |
ivanyohuno | 0:22b6f7132818 | 2 | #define NEOPIXELS_SPI_H |
ivanyohuno | 0:22b6f7132818 | 3 | #include <string.h> |
ivanyohuno | 0:22b6f7132818 | 4 | #include <stdio.h> |
ivanyohuno | 0:22b6f7132818 | 5 | #include "mbed.h" |
ivanyohuno | 0:22b6f7132818 | 6 | class neopixels_spi{ |
ivanyohuno | 0:22b6f7132818 | 7 | public: |
ivanyohuno | 0:22b6f7132818 | 8 | //function declarations |
ivanyohuno | 0:22b6f7132818 | 9 | void setRGBStrip1(int r, int g, int b); //sets colour of a strip of 8 RGB Pixels on pin 5 |
ivanyohuno | 0:22b6f7132818 | 10 | void setRGBStrip2(int r, int g, int b); //sets colour of a strip of 8 RGB Pixels on pin 11 |
ivanyohuno | 0:22b6f7132818 | 11 | void setRGBPixels1(int colours[8][3]); //sets sequence of colours for a strip of 8 RGB Pixels on pin 5 |
ivanyohuno | 0:22b6f7132818 | 12 | void setRGBPixels2(int colours[8][3]); //sets sequence of colours for a strip of 8 RGB Pixels on pin 11 |
ivanyohuno | 0:22b6f7132818 | 13 | void spi_init(); //initializes SPI pin at correct bit length and bit rate |
ivanyohuno | 0:22b6f7132818 | 14 | int * decimalToBinary(int n); //converts a decimal value between 0 and 255 to an 8 bit binary array of 0xF00 (0) and 0xFF0 (1) |
ivanyohuno | 0:22b6f7132818 | 15 | }; |
ivanyohuno | 0:22b6f7132818 | 16 | |
ivanyohuno | 0:22b6f7132818 | 17 | #endif |