I'm using Arduino to load a basic script to type text onto a screen onto the ATMega32U4 (using Arduino/Genuine Micro) board, but I keep getting a "not enough memory" error - there should be 28k available for me to use as text.
I tried loading a text script of only 2.5k and got this message "Sketch uses 7812 bytes (27%) of program storage space. Maximum is 28672 bytes.
Global variables use 2724 bytes (106%) of dynamic memory, leaving -164 bytes for local variables. Maximum is 2560 bytes.
Not enough memory. Error compiling for board Arduino/Genuino Micro.
So why am I unable to input more than 2k when the description says it should be at least 28k? My understanding of the GV is that those are the actual codes (i.e. keyboarder.begin) but the rest of the string should be in the program storage space...
Here's the full code:
#include "Keyboard.h"
void setup() {
// put your setup code here, to run once:
Keyboard.begin();
delay(5000);
Keyboard.print("testing") ;
Keyboard.end();
}
void loop() {
// put your main code here, to run repeatedly:
Keyboard.begin();
delay(5000);
Keyboard.print("2.5k code was here but I replaced it with this text"
Keyboard.end();
}
So I guess the short way of asking what I'm asking is this - how do I use the program storage space (28k) to hold text that I want typed? I assume PROGMEM would be the way to do this, but how can I have what's programmed into memory typed as text on screen?