mortonkopf
Well-known member
Hi all,
I have ben using Teensy 2++ for running an LPD6803 Led array with the colour values to be displayed stored in PROGMEM. I have been using the FastSPI lib to drive these. My code for this was along the lines of:
in setup
FastSPI_LED.setChipset(CFastSPI_LED::SPI_LPD6803);
in loop
unsigned int array0[] PROGMEM = {0x7fff, 0x7fff, 0x7fff, 0x7fff, etc (these are 15bit colour leds)
Led[led_number1]= pgm_read_dword((uint32_t)(&(array)));
etc for the Led array locations, where i is the incremented value to find the array location.
It may not have been the most efficient, and was probably incorrect but, hey, it worked. (I think that I should have declared uint16_t).
I am moving over to the new FastSPI_LED2 lib and am using 24bit colour ws2811 leds, but am having issues with accessing the array values. I the Teensy 3 and leds up and running with non array values, producing patterns mathematically. However, I have the array of 0x123456 colour values, but can't seem to get the correct syntax for FastSPI_LED2 to access the correct location in flash. I have been reading the examples, but not found anything that makes sense to me for this issue.
I have declared the array as:
const unsigned int array[] = { 0x00FF00, 0xFFFF00, 0xFF00FF, etc
and am trying to access the value by using:
leds[led_number1]= CRGB{array};
Any idea whether this syntax is correct?
I'm thinking that as CRGB struct is in the for of {byte g, byte r, byte b}, I must have to do some for of bit shift:
leds[led_number1]= CRGB{(array)??16,((array)??8),(array)};
but this seems over complicated
many thanks for the help
mortonkopf.
I have ben using Teensy 2++ for running an LPD6803 Led array with the colour values to be displayed stored in PROGMEM. I have been using the FastSPI lib to drive these. My code for this was along the lines of:
in setup
FastSPI_LED.setChipset(CFastSPI_LED::SPI_LPD6803);
in loop
unsigned int array0[] PROGMEM = {0x7fff, 0x7fff, 0x7fff, 0x7fff, etc (these are 15bit colour leds)
Led[led_number1]= pgm_read_dword((uint32_t)(&(array)));
etc for the Led array locations, where i is the incremented value to find the array location.
It may not have been the most efficient, and was probably incorrect but, hey, it worked. (I think that I should have declared uint16_t).
I am moving over to the new FastSPI_LED2 lib and am using 24bit colour ws2811 leds, but am having issues with accessing the array values. I the Teensy 3 and leds up and running with non array values, producing patterns mathematically. However, I have the array of 0x123456 colour values, but can't seem to get the correct syntax for FastSPI_LED2 to access the correct location in flash. I have been reading the examples, but not found anything that makes sense to me for this issue.
I have declared the array as:
const unsigned int array[] = { 0x00FF00, 0xFFFF00, 0xFF00FF, etc
and am trying to access the value by using:
leds[led_number1]= CRGB{array};
Any idea whether this syntax is correct?
I'm thinking that as CRGB struct is in the for of {byte g, byte r, byte b}, I must have to do some for of bit shift:
leds[led_number1]= CRGB{(array)??16,((array)??8),(array)};
but this seems over complicated
many thanks for the help
mortonkopf.
Last edited: