updated

Fork of neopixels_spi by Ivan Yohuno

Committer:
el12moe
Date:
Wed May 13 17:52:07 2015 +0000
Revision:
1:2023e348c15f
Parent:
0:22b6f7132818
The code for controlling the light modes from the app;

Who changed what in which revision?

UserRevisionLine numberNew 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