teapLED

Dependencies:   PololuLedStrip mbed

color.h

Committer:
tanabe2000
Date:
2017-09-01
Revision:
0:84c4f17abdc1

File content as of revision 0:84c4f17abdc1:

#include "mbed.h"
#include "PololuLedStrip.h"

#define WEIT 1000
#define LED_COUNT 60
#define RED         255 ,0  ,0
#define ORANGE      255 ,0  ,130
#define YELLOW      255 ,255,0
#define GREEN       0   ,255,0
#define LIGHT_BLUE  0   ,255,255
#define BLUE        0   ,0  ,255
#define PURPLE      0   ,255,130
#define PINK        255 ,0  ,255


Timer timer;
PololuLedStrip ledStrip(PA_5);
rgb_color colors[LED_COUNT];

void red (){

    for(uint32_t i = 0; i < LED_COUNT; i++){
            colors[i] = (rgb_color){255 ,0  ,0};
        }
        ledStrip.write(colors, LED_COUNT);
        wait_ms(WEIT);
}

void orange (){

    for(uint32_t i = 0; i < LED_COUNT; i++){
            colors[i] = (rgb_color){ORANGE};
        }
        ledStrip.write(colors, LED_COUNT);
        wait_ms(WEIT);

}

void yellow (){

    for(uint32_t i = 0; i < LED_COUNT; i++){
            colors[i] = (rgb_color){YELLOW};
        }
        ledStrip.write(colors, LED_COUNT);
        wait_ms(WEIT);

}

void green (){

    for(uint32_t i = 0; i < LED_COUNT; i++){
            colors[i] = (rgb_color){GREEN};
        }
        ledStrip.write(colors, LED_COUNT);
        wait_ms(WEIT);

}

void lgreen (){

    for(uint32_t i = 0; i < LED_COUNT; i++){
            colors[i] = (rgb_color){LIGHT_BLUE};
        }
        ledStrip.write(colors, LED_COUNT);
        wait_ms(WEIT);

}

void blue (){

    for(uint32_t i = 0; i < LED_COUNT; i++){
            colors[i] = (rgb_color){BLUE};
        }
        ledStrip.write(colors, LED_COUNT);
        wait_ms(WEIT);

}

void purple (){

    for(uint32_t i = 0; i < LED_COUNT; i++){
            colors[i] = (rgb_color){PURPLE};
        }
        ledStrip.write(colors, LED_COUNT);
        wait_ms(WEIT);

}

void pink (){

    for(uint32_t i = 0; i < LED_COUNT; i++){
            colors[i] = (rgb_color){PINK};
        }
        ledStrip.write(colors, LED_COUNT);
        wait_ms(WEIT);

}