使用M2tklib和glcd获取“部分类型冲突”

时间:2014-05-29 00:24:51

标签: arduino conflict lcd

我需要一些帮助来解决"部分类型冲突"在我写的arduino程序中。我有一个产生错误的简短示例代码:

#include <glcd.h>
#include "M2tk.h"
#include "utility/m2ghglcd.h"
#include "bitmaps/allBitmaps.h"   

// Definitions of Main Menu
  M2_LABEL(el_label_MainMenu,NULL,"Main Menu");
  // Construct Main Menu List
  M2_LIST(list_main_menu) = {&el_label_MainMenu};
  M2_VLIST(el_list_main_menu,NULL,list_main_menu);
  M2_ALIGN(el_main_menu, "W64H64", &el_list_main_menu);

M2tk m2(&el_main_menu, m2_es_arduino, m2_eh_4bd, m2_gh_glcd_ffs);

void setup() {
  GLCD.Init();   // initialise the library
  GLCD.DrawBitmap(ArduinoIcon64x32, 32,0); //draw the bitmap at the given x,y position
  delay(3000);
  GLCD.ClearScreen();
}
void loop() {  
  m2.checkKey(); 
  m2.draw();
}

我正在尝试为菜单驱动程序创建启动画面。我觉得它与arduino Icon图像的PROGMEM定义有关。它们被定义为标准GLCD库的一部分。我不确定是什么问题或者如何解决它。

确切的错误消息是:

C:\ Users \ Dirk \ Documents \ Arduino \ libraries \ glcd / bitmaps / ArduinoIcon64x32.h:25:错误:ArduinoIcon64x32导致部分类型冲突

它对ArduinoIcon64x32的定义方式并不感兴趣。这是图像文件的定义方式:

#ifndef _ArduinoIcon64x32_H 
#define _ArduinoIcon64x32_H 

#include <inttypes.h>
#include <avr/pgmspace.h>

static unsigned char ArduinoIcon64x32[] PROGMEM ={
64, // bitmap width  (arduino glcdlib format)
32, // bitmap height (arduino glcdlib format)
0x00, 0x00, 0xc0, 0x20, 0x10, 0x08, 0xc8, 0x88, 0x08, 0x08, 0x10, 0x20, 0xc0, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xf8, 0xf8, 0xf8, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x40, 
0x70, 0x0c, 0x30, 0xc0, 0x00, 0xc0, 0x30, 0x0c, 0x30, 0xc0, 0x00, 0xc0, 0x30, 0x08, 0x88, 0x48, 
0x28, 0x28, 0xf8, 0x20, 0x20, 0x40, 0x80, 0x40, 0x20, 0x10, 0x20, 0x98, 0x18, 0xc0, 0xc0, 0x00, 

0x00, 0x07, 0x18, 0x20, 0x40, 0x80, 0x9f, 0x8f, 0x87, 0x82, 0x40, 0x20, 0x18, 0x07, 0x00, 0x00, 
0x00, 0x00, 0x80, 0xf0, 0xfe, 0xff, 0xff, 0x1f, 0x03, 0x1f, 0xff, 0xff, 0xfc, 0xf0, 0x80, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x1c, 0x63, 0x80, 0x46, 
0x4a, 0x52, 0xe3, 0x52, 0x4a, 0x46, 0x80, 0x63, 0x1c, 0x02, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 

0x00, 0xc0, 0x30, 0x08, 0x04, 0xe2, 0x22, 0x22, 0x22, 0xe2, 0x04, 0x08, 0x30, 0xc0, 0x00, 0x00, 
0xe0, 0xfc, 0xff, 0xff, 0x7f, 0x7f, 0x78, 0x78, 0x78, 0x78, 0x78, 0x7f, 0x7f, 0xff, 0xff, 0xfc, 
0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 
0x02, 0x02, 0xff, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x01, 0x06, 0x08, 0x10, 0x23, 0x22, 0x22, 0x22, 0x23, 0x10, 0x08, 0x06, 0x01, 0x18, 0x3f, 
0x3f, 0x3f, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0f, 0x3f, 
0x3f, 0x3f, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 
0x0a, 0x0a, 0x2b, 0x0a, 0x0a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

};
#endif  //define _ArduinoIcon64x32_H 

您可以提供任何指示和帮助或生成启动画面的替代方法。

0 个答案:

没有答案
相关问题