snowsh
Well-known member
I want to be able to set the number of leds in my UX. I am adding neopixels to a MIDI controller keyboard. I have a 25 key mini keyboard, but I want to support up to 88 keys.
At present, I set memory as suggested in the examples:
I now have a new keyboard, with more keys. I have put this off but now it's time to do this dynamically. How best to do this in setup? I will add to my UX to allow the user to define the number of keys, start and end keys, etc..
So, how best can this memory be declared in runtime?
#EDIT
I am happy to use EXTMEM if this can stay fast......
At present, I set memory as suggested in the examples:
C++:
const int numled PROGMEM = 425;//375; // grid = 256 keyboard buttons = 64, keyboard buttons = 16, encoder = 5, shift = 1, extra = 1, pots = 32, pianoKeys = 50
byte drawingMemory[numled * 3]; // 3 bytes per LED
DMAMEM byte displayMemory[numled * 12]; // 12 bytes per LED
I now have a new keyboard, with more keys. I have put this off but now it's time to do this dynamically. How best to do this in setup? I will add to my UX to allow the user to define the number of keys, start and end keys, etc..
So, how best can this memory be declared in runtime?
#EDIT
I am happy to use EXTMEM if this can stay fast......
Last edited: