Skip to content

Commit

Permalink
Added green/red boat effect
Browse files Browse the repository at this point in the history
  • Loading branch information
evoggy committed Jan 7, 2015
1 parent e5fd62b commit cb86e51
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions modules/src/neopixelring.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,44 @@ static void solidColorEffect(uint8_t buffer[][3], bool reset)
}
}

static const uint8_t green[] = {0x00, 0xFF, 0x00};
static const uint8_t red[] = {0xFF, 0x00, 0x00};
static const uint8_t white[] = WHITE;
static const uint8_t part_black[] = BLACK;

static void boatEffect(uint8_t buffer[][3], bool reset)
{
int i;

uint8_t reds[] = {1,2,3,4,5};
uint8_t greens[] = {7,8,9,10,11};
uint8_t whites[] = {0};
uint8_t blacks[] = {6};


for (i=0; i<sizeof(reds); i++)
{
COPY_COLOR(buffer[reds[i]], red);
}

for (i=0; i<sizeof(greens); i++)
{
COPY_COLOR(buffer[greens[i]], green);
}

for (i=0; i<sizeof(whites); i++)
{
COPY_COLOR(buffer[whites[i]], white);
}

for (i=0; i<sizeof(blacks); i++)
{
COPY_COLOR(buffer[blacks[i]], part_black);
}


}

/**************** Color spin ***************/

static const uint8_t colorRing[][3] = {{0,0,32}, {0,0,16}, {0,0,8},
Expand Down Expand Up @@ -416,6 +454,7 @@ NeopixelRingEffect effectsFct[] = {blackEffect,
solidColorEffect,
ledTestEffect,
batteryChargeEffect,
boatEffect
}; //TODO Add more

/*
Expand Down

0 comments on commit cb86e51

Please sign in to comment.