Skip to content

Commit

Permalink
Version 3.5
Browse files Browse the repository at this point in the history
Fixed sequence bug.
Note that AlaSeq struct has different order for the variables.
  • Loading branch information
bportaluri committed Oct 24, 2015
1 parent 398f265 commit 97321cb
Show file tree
Hide file tree
Showing 19 changed files with 164 additions and 154 deletions.
7 changes: 4 additions & 3 deletions examples/MultiAnimations/MultiAnimations.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////////////////
//
// ALA library example: ALA Example - ComplexMultitasking
// ALA library example: MultiAnimations
//
// Example to demonstrate how to drive different set of LEDs independently
// using Arduino PWM output pins a TLC5940 chip and an WS2812 strip.
Expand All @@ -9,8 +9,8 @@
//
///////////////////////////////////////////////////////////////////////////////////////////

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

byte tlcPins1[] = { 1, 2, 3 };
byte tlcPins2[] = { 6,7,8, 9,10,11, 12,13,14 };
Expand Down Expand Up @@ -45,3 +45,4 @@ void loop()
rgbLeds.runAnimation();
rgbStrip.runAnimation();
}

14 changes: 13 additions & 1 deletion examples/MultiLedSequence/MultiLedSequence.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,16 @@
#include <AlaLed.h>

AlaLed leds;

// pins where the leds are connected
byte pins[] = { 5, 6, 9, 10, 11 };

// declare the animation sequence
// each row has three values:
// 1 - a numeric code identifying the desired animation, valid codes are listed in the Ala.h
// 2 - the duration of the loop animationin milliseconds
// 3 - the total duration of the animation in milliseconds

AlaSeq seq[] =
{
{ ALA_FADEIN, 1000, 1000 },
Expand All @@ -36,11 +44,15 @@ AlaSeq seq[] =

void setup()
{
leds.initPWM(3, pins);
// initialize the 5 leds attached to PWM pins
leds.initPWM(5, pins);

// set the animation sequence
leds.setAnimation(seq);
}

void loop()
{
// run the animation
leds.runAnimation();
}
21 changes: 11 additions & 10 deletions examples/RgbLedSequence/RgbLedSequence.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Example to demonstrate how to create an animation sequence for one RGB LED.
// The example also shows how to create and use a custom color palette.
//
// Web page: http://yaab-arduino.blogspot.com/p/ala-example-rgbledsequence.html
// Web page: http://yaab-arduino.blogspot.com/p/ala-example-rgbledseq.html
//
///////////////////////////////////////////////////////////////////////////////////////////

Expand All @@ -17,21 +17,21 @@

AlaLedRgb rgbLed;

// custom palette : black , white , black , red , green , blue
// custom palette : black white black red green blue
AlaColor mycolors_[6] = { 0x000000, 0xFFFFFF, 0x000000, 0xFF0000, 0x00FF00, 0x0000FF };
AlaPalette mycolors = { 6, mycolors_ };


AlaSeq seq[] =
{
{ ALA_CYCLECOLORS, 3000, alaPalRgb, 3000 },
{ ALA_OFF, 1000, alaPalNull, 1000 },
{ ALA_FADECOLORSLOOP, 4000, alaPalRgb, 8000 },
{ ALA_FADECOLORSLOOP, 500, mycolors, 4000 },
{ ALA_OFF, 1000, alaPalNull, 1000 },
{ ALA_FADECOLORS, 5000, mycolors, 5000 },
{ ALA_OFF, 1000, alaPalNull, 1000 },
{ ALA_ENDSEQ, 0, alaPalNull, 0 }
{ ALA_CYCLECOLORS, 3000, 3000, alaPalRgb },
{ ALA_OFF, 1000, 1000, alaPalNull },
{ ALA_FADECOLORSLOOP, 4000, 8000, alaPalRgb },
{ ALA_FADECOLORSLOOP, 500, 4000, mycolors },
{ ALA_OFF, 1000, 1000, alaPalNull },
{ ALA_FADECOLORS, 5000, 5000, mycolors },
{ ALA_OFF, 1000, 1000, alaPalNull },
{ ALA_ENDSEQ }
};


Expand All @@ -50,3 +50,4 @@ void loop()
{
rgbLed.runAnimation();
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
///////////////////////////////////////////////////////////////////////////////////////////
//
// ALA library example: RgbStripButton
//
// Example to demonstrate how to switch animations using three buttons.
// The first button change the animation.
// The second button the color palette.
// The third button change the animation speed.
//
// Button library is required: http://playground.arduino.cc/Code/Button
//
// Web page: http://yaab-arduino.blogspot.com/p/ala-example-rgbstripbutton.html
//
///////////////////////////////////////////////////////////////////////////////////////////

#include "AlaLedRgb.h"
#include "Button.h"
#include <AlaLedRgb.h>
#include <Button.h>


AlaLedRgb rgbStrip;
Expand Down Expand Up @@ -82,3 +96,4 @@ void updateAnimation()
{
rgbStrip.setAnimation(animList[animation%14], durationList[duration%3], paletteList[palette%3]);
}

65 changes: 0 additions & 65 deletions examples/RgbStripDemo/RgbStripDemo.ino

This file was deleted.

60 changes: 60 additions & 0 deletions examples/RgbStripSequence/RgbStripSequence.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
///////////////////////////////////////////////////////////////////////////////////////////
//
// ALA library example: RgbStripSequence
//
// Example to demonstrate how to create an animation sequence for a
// WS2812 RGB LED strip.
//
// Web page: http://yaab-arduino.blogspot.com/p/ala-example-rgbstripseq.html
//
///////////////////////////////////////////////////////////////////////////////////////////

#include <AlaLedRgb.h>

AlaLedRgb rgbStrip;


AlaSeq seq[] =
{
{ ALA_OFF, 1000, 2000, alaPalNull },
{ ALA_ON, 1000, 2000, alaPalRgb },
{ ALA_SPARKLE, 1000, 9000, alaPalRgb },
{ ALA_CYCLECOLORS, 3000, 6000, alaPalRgb },
{ ALA_OFF, 1000, 1000, alaPalNull },
{ ALA_FADECOLORSLOOP, 3000, 6000, alaPalRgb },
{ ALA_SPARKLE2, 1000, 6000, alaPalRgb },
{ ALA_OFF, 1000, 1000, alaPalNull },
{ ALA_SPARKLE2, 1000, 6000, alaPalFire },
{ ALA_PIXELSMOOTHSHIFTRIGHT, 6000, 2000, alaPalRgb },
{ ALA_OFF, 1000, 1000, alaPalNull },
{ ALA_MOVINGBARS, 3000, 6000, alaPalRgb },
{ ALA_COMET, 3000, 6000, alaPalRgb },
{ ALA_COMETCOL, 3000, 6000, alaPalRgb },
{ ALA_OFF, 1000, 1000, alaPalNull },
{ ALA_GLOW, 3000, 6000, alaPalRgb },
{ ALA_OFF, 1000, 1000, alaPalNull },
{ ALA_FIRE, 1000, 6000, alaPalFire },
{ ALA_OFF, 1000, 1000, alaPalNull },
{ ALA_BOUNCINGBALLS, 1000, 6000, alaPalRgb },
{ ALA_OFF, 1000, 1000, alaPalNull },
{ ALA_BUBBLES, 1000, 6000, alaPalRainbow },
{ ALA_ENDSEQ }
};


void setup()
{
delay(1000);

rgbStrip.initWS2812(60, 6);

rgbStrip.setBrightness(0x444444);

rgbStrip.setAnimation(seq);
}

void loop()
{
rgbStrip.runAnimation();
}

6 changes: 3 additions & 3 deletions examples/SimpleLed/SimpleLed.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
//
///////////////////////////////////////////////////////////////////////////////////////////


#include <AlaLed.h>

AlaLed alaLed;

void setup()
{
// initialize the led attached to pin 11
// initialize the led attached to pin 11 with PWM driver
alaLed.initPWM(11);

// set a fading animation with a duration of 2 seconds
Expand All @@ -24,6 +23,7 @@ void setup()

void loop()
{
// animate the led
// run the animation
alaLed.runAnimation();
}

Binary file modified examples/SimpleLed/schematic/SimpleLed_bb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/SimpleLed/schematic/SimpleLed_schem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/SimpleRgbLed/SimpleRgbLed.ino
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ void loop()
{
rgbLed.runAnimation(); // run the animation indefinitely
}

10 changes: 7 additions & 3 deletions examples/SimpleRgbStrip/SimpleRgbStrip.ino
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////
//
// ALA library example: RgbStrip
// ALA library example: SimpleRgbStrip
//
// Example to demonstrate how to create display a color-fading animation for a
// WS2812 RGB LED strip.
//
// Web page: http://yaab-arduino.blogspot.com/p/ala-example-rgbstrip.html
// Web page: http://yaab-arduino.blogspot.com/p/ala-example-simplergbstrip.html
//
///////////////////////////////////////////////////////////////////////////////////////////

#include "AlaLedRgb.h"
#include <AlaLedRgb.h>

AlaLedRgb rgbStrip;

void setup()
{
// initialize the WS2812 strip with 30 leds on pin 6
rgbStrip.initWS2812(30, 6);

// set a color-fading animation with a duration of 5 seconds and an RGB palette
rgbStrip.setAnimation(ALA_FADECOLORSLOOP, 5000, alaPalRgb);
}

void loop()
{
// run the animation
rgbStrip.runAnimation();
}

3 changes: 2 additions & 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 All @@ -24,3 +24,4 @@ void loop()
{
alaLed.runAnimation();
}

2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ALA
version=2.2.0
version=2.3
author=bportaluri
maintainer=Bruno Portaluri <[email protected]>
sentence=Arduino Light Animation (ALA) is a library
Expand Down
2 changes: 0 additions & 2 deletions src/Ala.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "Ala.h"

#include "Arduino.h"


int getStep(long t0, long t, int v)
{
Expand Down
Loading

0 comments on commit 97321cb

Please sign in to comment.