最近在学习12864,但是弄了好久还没有折腾出来,跑的官方例程,
但是好多东西不理解:
#include "U8glib.h" U8GLIB_SSD1306_128X64 u8g(13 11 10 9); // SW SPI Com: SCK = 13 MOSI = 11 CS = 10 A0 = 9 #define u8g_logo_width 38 #define u8g_logo_height 24 //static unsigned char u8g_logo_bits[] = { static unsigned char u8g_logo_bits[] U8G_PROGMEM = { 0xff 0xff 0xff 0xff 0x3f 0xff 0xff 0xff 0xff 0x3f 0xf0 0xe0 0xff 0xff 0x3f 0xe3 0xe1 0xff 0xff 0x3f 0xf3 0xf1 0xff 0xff 0x3f 0xf3 0xf1 0xfe 0xbf 0x37 0xf3 0x11 0x1c 0x1f 0x30 0xf3 0x01 0x08 0x8c 0x20 0xf3 0x01 0x00 0xc0 0x39 0xf3 0x81 0xc7 0xc1 0x39 0xf3 0xc1 0xc7 0xc9 0x38 0xf3 0xc1 0xc3 0x19 0x3c 0xe3 0x89 0x01 0x98 0x3f 0xc7 0x18 0x00 0x08 0x3e 0x0f 0x3c 0x70 0x1c 0x30 0x3f 0xff 0xfc 0x87 0x31 0xff 0xff 0xbf 0xc7 0x23 0x01 0x00 0x00 0xc6 0x23 0x03 0x00 0x00 0x0e 0x30 0xff 0xff 0x3f 0x1f 0x3c 0xff 0xff 0x3f 0xff 0x3f 0xff 0xff 0x3f 0xff 0x3f 0xff 0xff 0xff 0xff 0x3f 0xff 0xff 0xff 0xff 0x3f }; void draw(void) { // graphic commands to redraw the complete screen should be placed here u8g.drawXBMP( 0 0 u8g_logo_width u8g_logo_height u8g_logo_bits); } void setup(void) { // flip screen if required // u8g.setRot180(); } void loop(void) { // picture loop u8g.firstPage(); do { draw(); } while( u8g.nextPage() ); // rebuild the picture after some delay delay(500); }
各位前辈有没有中文的函数说明,
这段代码参考官方说明文档应该不难理解吧。
题外话:代码中都吃掉了逗号啊,现在官方环境有问题啊。