Hello I'm making smart glasses. I had a little problem with the code. Help me.
(deleted)
this |
|
v
@enkhsuren, you have posted a very large program. What is the problem with it?
Is this a program you created yourself? If so how did it get so large before you noticed the problem?
...R
I'm sorry. This is not my code. I copied this code to make smart glasses
Please post the error message (s)
bitmap.h:1243:43: error: variable 'bitmap_array' must be const in order to be put into read-only section by means of 'attribute((progmem))'
PROGMEM const unsigned char* bitmap_array[] = {
^
RetroWatchArduino_u8glib_no_button:83:32: error: variable 'weekString' must be const in order to be put into read-only section by means of 'attribute((progmem))'
PROGMEM const char* weekString[] = {"", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
^
RetroWatchArduino_u8glib_no_button:84:32: error: variable 'ampmString' must be const in order to be put into read-only section by means of 'attribute((progmem))'
PROGMEM const char* ampmString[] = {"AM", "PM"};
^
RetroWatchArduino_u8glib_no_button:121:30: error: variable 'strIntro' must be const in order to be put into read-only section by means of 'attribute((progmem))'
PROGMEM const char* strIntro[] = {"Retro", "Watch", "Arduino v1.0"};
^
exit status 1
variable 'bitmap_array' must be const in order to be put into read-only section by means of 'attribute((progmem))'
Same error in every line you posted, the char * is being declared const, but the array is not.
PROGMEM const unsigned char* bitmap_array[] = { //error - bitmap_array[] needs to be declared const
PROGMEM const unsigned char* const bitmap_array[] = { //correct way to declare the array for progmem
The arrays of text are not being declared correctly if the intent is to store the actual text in PROGMEM.
PROGMEM const char* const weekString[] = {"", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
The array weekString[] is being stored in PROGMEM, but the actual text for the days of the week is being stored in ram (dynamic memory). Can be left this way if the code runs properly, not worth the trouble to change unless you are going to be modifying the code in other ways and need the ram.