Skip to content

Commit

Permalink
Release 2.0
Browse files Browse the repository at this point in the history
Minor changes and source code moved to 'src' subfolder.
  • Loading branch information
bportaluri committed Apr 2, 2015
1 parent 739bb8a commit 313e625
Show file tree
Hide file tree
Showing 25 changed files with 31 additions and 16 deletions.
2 changes: 1 addition & 1 deletion examples/SimpleTlc5940/SimpleTlc5940.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
///////////////////////////////////////////////////////////////////////////////////////////

#include <AlaLed.h>
#include "AlaLed.h"

AlaLed alaLed;

Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ALA_STROBO LITERAL1
ALA_FADECOLORSLOOP LITERAL1
ALA_FADECOLORS LITERAL1
ALA_CYCLECOLORS LITERAL1
ALA_PIXELSFADECOLORS LITERAL1

ALA_PIXELSHIFTRIGHT LITERAL1
ALA_PIXELSHIFTLEFT LITERAL1
Expand All @@ -57,6 +58,7 @@ ALA_BARSHIFTLEFT LITERAL1
ALA_LARSONSCANNER LITERAL1
ALA_LARSONSCANNER2 LITERAL1
ALA_MOVINGBARS LITERAL1
ALA_MOVINGGRADIENT LITERAL1

ALA_FADEIN LITERAL1
ALA_FADEOUT LITERAL1
Expand Down
9 changes: 9 additions & 0 deletions library.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name=ALA
version=2.0
author=bportaluri
maintainer=Bruno Portaluri <[email protected]>
sentence=Arduino Light Animation (ALA) is a library
paragraph=Arduino Light Animation (ALA) is a library for Arduino boards to simplify the development of light animations using LEDs and LED strips.
category=Other
url=https://github.com/bportaluri/ALA
architectures=*
File renamed without changes.
8 changes: 4 additions & 4 deletions Ala.h → src/Ala.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ typedef struct AlaColor
{
return(this->r == c.r and this->g == c.g and this->b == c.b);
}
/*
AlaColor getPixel(AlaColor maxOut)
{
return AlaColor(r*maxOut.r/255, g*maxOut.g/255, b*maxOut.b/255);
}

*/
AlaColor sum(AlaColor color)
{
int r0 = min(color.r + r, 255);
Expand Down Expand Up @@ -194,9 +194,9 @@ typedef struct AlaPalette
typedef struct AlaSeq
{
int animation;
int speed;
long speed;
AlaPalette palette;
int duration;
long duration;
};


Expand Down
6 changes: 5 additions & 1 deletion AlaLed.cpp → src/AlaLed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void AlaLed::setRefreshRate(int refreshRate)
}


void AlaLed::setAnimation(int animation, int speed)
void AlaLed::setAnimation(int animation, long speed)
{
if (this->animation == animation && this->speed == speed)
return;
Expand All @@ -88,6 +88,10 @@ void AlaLed::setAnimation(AlaSeq animSeq[])

}

void AlaLed::nextAnimation()
{
currAnim = (currAnim+1)%animSeqLen;
}

void AlaLed::runAnimation()
{
Expand Down
9 changes: 5 additions & 4 deletions AlaLed.h → src/AlaLed.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ class AlaLed
* May be useful to reduce flickering in some cases.
*/
void setRefreshRate(int refreshRate);

int getRefreshRate();


void setAnimation(int animation, int speed);
void setAnimation(int animation, long speed);
void setAnimation(AlaSeq animSeq[]);

void runAnimation();

void nextAnimation();


private:
Expand Down Expand Up @@ -104,8 +105,8 @@ class AlaLed
int refreshMillis;

int animation;
int currAnim;
long speed;

AlaSeq *animSeq;
int animSeqLen;
long animSeqDuration;
Expand Down
7 changes: 3 additions & 4 deletions AlaLedRgb.cpp → src/AlaLedRgb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int AlaLedRgb::getRefreshRate()
}


void AlaLedRgb::setAnimation(int animation, int speed, AlaColor color)
void AlaLedRgb::setAnimation(int animation, long speed, AlaColor color)
{
if (this->animation == animation && this->speed == speed && this->palette.numColors == 1 && this->palette.colors[0] == color)
return;
Expand All @@ -127,7 +127,7 @@ void AlaLedRgb::setAnimation(int animation, int speed, AlaColor color)
animStartTime = millis();
}

void AlaLedRgb::setAnimation(int animation, int speed, AlaPalette palette)
void AlaLedRgb::setAnimation(int animation, long speed, AlaPalette palette)
{
if (this->animation == animation && this->speed == speed && this->palette == palette)
return;
Expand Down Expand Up @@ -268,7 +268,6 @@ void AlaLedRgb::setAnimationFunc(int animation)
case ALA_PIXELSFADECOLORS: animFunc = &AlaLedRgb::pixelsFadeColors; break;
case ALA_FADECOLORS: animFunc = &AlaLedRgb::fadeColors; break;
case ALA_FADECOLORSLOOP: animFunc = &AlaLedRgb::fadeColorsLoop; break;


case ALA_FIRE: animFunc = &AlaLedRgb::fire; break;
case ALA_BOUNCINGBALLS: animFunc = &AlaLedRgb::bouncingBalls; break;
Expand Down Expand Up @@ -721,7 +720,7 @@ void AlaLedRgb::bubbles()

for (int i=0; i<palette.numColors; i++)
{
pxPos[i] = 0;
pxPos[i] = ((float)random(255))/255;
pxSpeed[i] = 0;
}
lastRefresh = millis();
Expand Down
4 changes: 2 additions & 2 deletions AlaLedRgb.h → src/AlaLedRgb.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class AlaLedRgb
int getRefreshRate();


void setAnimation(int animation, int speed, AlaColor color);
void setAnimation(int animation, int speed, AlaPalette palette);
void setAnimation(int animation, long speed, AlaColor color);
void setAnimation(int animation, long speed, AlaPalette palette);
void setAnimation(AlaSeq animSeq[]);
bool runAnimation();
void nextAnimation();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 313e625

Please sign in to comment.