new clock project staring using the APA102-202 LED

Status
Not open for further replies.

philip.porhammer

Well-known member
what would be an appreciate driver for this RGB LED? The clock will be 2 rings of LEDs, 96 on the inside and 120 outside. I will drive it with a Teency 3.2 with time base from a GPS.
 
What does the "202" part mean? The closest info I can find is "2020", indicating a regular APA102 in a smaller 2 mm package.

FastLED supports APA102. Just last week I did quite a bit of testing with APA102 at high speeds, since problems are common when using the fastest clocks. Here's a writeup.

https://www.pjrc.com/why-apa102-leds-have-trouble-at-24-mhz/

They work great if you stay with the default speed. To get started, make sure Teensy is selected in Arduino's Tools > Boards menu. The other menus update depending on the selected board. Then click File > Examples > FastLED. In that blog article, I used the "Cylon" example, and you can see I changed only 1 line to switch from WS2812B to APA102.

Code:
 LEDS.addLeds<APA102,11,13,RGB,DATA_RATE_MHZ(24)>(leds,NUM_LEDS);

There's a Google+ group for FastLED. If you have FastLED-specific questions, that's the best place to ask.

https://plus.google.com/communities/109127054924227823508

Like all forums, showing the actual code and hardware you're using allows people to give you much better answers. The FastLED devs are on that Google+ group.
 
The following is test code for a string of APA102 LED. we hope to get a card back with the SMD LEDs mounted to a card. it is a clock with 120 on the outer ring and 96 on the inner ring. The second hand is a set of 6 LEDs illuminated in a SIN wave distribution that moves at 10Hz update rate around the otter ring. I would like to use the stereo audio out put to make it into an alarm clock.

Can the audio output function of the T3.6 work with updating at 10Hz? or would I need to pause the clock when the audio output is active?



#include <Adafruit_DotStar.h>
// Because conditional #includes don't work w/Arduino sketches...
#include <SPI.h>
#define NUMPIXELS 214 // Number of LEDs in strip

// Here's how to control the LEDs from any two pins:
#define DATAPIN 4 // key top pin
#define CLOCKPIN 5 // mid pin
Adafruit_DotStar strip = Adafruit_DotStar(
NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BRG);


int SecSteps=0;
int TimeIndex=-2;
void setup() {

#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000L)
clock_prescale_set(clock_div_1); // Enable 16 MHz on Trinket
#endif

strip.begin(); // Initialize pins for output
strip.show(); // Turn all LEDs off ASAP

}

int StartUpA[]={ 0x010000, 0x010000, 0x010000, 0x030000, 0x060000, };
int StartUpB[]={ 0x090000, 0x0D0000, 0x110000, 0x160000, 0x1A0000,};
int EndUpA[]={ 0x1F0000, 0x250000, 0x290000, 0x2E0000, 0x320000, };
int EndUpB[]={ 0x360000, 0x390000, 0x3C0000, 0x3E0000, 0x3F0000,};
int StartDownA[]={ 0x400000, 0x3F0000, 0x3E0000, 0x3C0000, 0x390000, };
int StartDownB[]={ 0x360000, 0x320000, 0x2E0000, 0x290000, 0x250000,};
int EndDownA[]={ 0x200000, 0x1A0000, 0x160000, 0x110000, 0x0D0000, };
int EndDownB[]={ 0x090000, 0x060000, 0x030000, 0x010000, 0x010000,};

void loop() {
for(int i=-7;i<15; i++){ strip.setPixelColor(i, 0x010000);} // set slight green
if(TimeIndex>12){TimeIndex=-4;}


SecSteps=0;
while(SecSteps<=4)
{

strip.setPixelColor(TimeIndex+4,StartUpA[SecSteps]); //g-r-b
strip.setPixelColor(TimeIndex+3,StartUpB[SecSteps]);//StartUp[SecSteps]);
strip.setPixelColor(TimeIndex+2,EndUpA[SecSteps]); //StartUp[SecSteps]);
strip.setPixelColor(TimeIndex+1,EndUpB[SecSteps]);
strip.setPixelColor(TimeIndex+0,StartDownA[SecSteps]); //g-r-b
strip.setPixelColor(TimeIndex-1,StartDownB[SecSteps]);//StartUp[SecSteps]);
strip.setPixelColor(TimeIndex-2,EndDownA[SecSteps]); //StartUp[SecSteps]);
strip.setPixelColor(TimeIndex-3,EndDownB[SecSteps]);
SecSteps=SecSteps+1;
strip.show();
delay(100);
}


TimeIndex=TimeIndex+1;
}
 
Status
Not open for further replies.
Back
Top