Разговор пойдёт о LCD4884 шилде с экраном от телефона Nokia и 5 позиционным джойстиком.
Купил я его, принёс домой, подключил, скачал нужные библиотеки, но не смог заставить его работать. Экран горел синим, но других признаков жизни не подавал. Все действия производились на IDE 1.6.5.
С помощью друзей с arduino-project.net начали разбираться в чём же причина.
Суть проблемы была такова, пытаемся залить простой скетч из примеров библиотеки LCD4884
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
/* Modified by Lauren version 0.1 Any suggestions are welcome. E-mail: Lauran.pan@gmail.com Editor : Lauren from DFRobot Date : 26.03.2012 * This is a sample sketch for displaying a variable value on the LCD4884 * This library and sample is compatible with the IDE V1.0 and earlier Connection: Directly stack the LCD4884 shield on your Arduino board */ #include "LCD4884.h" #define MENU_X 10 // 0-83 #define MENU_Y 1 // 0-5 int counter = 0; char string[10]; void setup() { lcd.LCD_init(); lcd.LCD_clear(); //menu initialization init_MENU(); } void init_MENU(void){ byte i; lcd.LCD_clear(); lcd.LCD_write_string(MENU_X, MENU_Y, "test screen", MENU_HIGHLIGHT ); } void loop(){ if(++counter < 1000){ itoa(counter,string,10); lcd.LCD_write_string(MENU_X, MENU_Y + 1, string, MENU_NORMAL); } else counter = 0,init_MENU(); delay(10); } |
Но IDE начинает ругаться уже при компиляции и выдавать ошибки.
|
Изменена опция сборки, пересобираем все In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28:0, from G:\Docs\Arduino\libraries\LCD4884\LCD4884.h:22, from G:\Docs\Arduino\libraries\LCD4884\LCD4884.cpp:18: G:\Docs\Arduino\libraries\LCD4884\font_6x8.h:6:29: error: variable 'font6_8' must be const in order to be put into read-only section by means of '__attribute__((progmem))' unsigned char font6_8[][6] PROGMEM = ^ G:\Docs\Arduino\libraries\LCD4884\font_big.h:9:39: error: variable 'big_number' must be const in order to be put into read-only section by means of '__attribute__((progmem))' unsigned char big_number[13][3][16] PROGMEM = { ^ Ошибка компиляции. |

Исходя из этих ошибок становится понятно что проблема кроется в файлах шрифтов в библиотеке font_6x8.h и font_big.h , решение этой проблемы достаточно банальным.
Читать далее »