错误信息:

Arduino:1.8.4 (Windows 7), 开发板:"Arduino/Genuino Uno"

C:\Program Files\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files\Arduino\hardware -hardware C:\Users\Administrator\AppData\Local\Arduino15\packages -tools C:\Program Files\Arduino\tools-builder -tools C:\Program Files\Arduino\hardware\tools\avr -tools C:\Users\Administrator\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files\Arduino\libraries -libraries C:\Users\Administrator\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10804 -build-path C:\Users\ADMINI~1\AppData\Local\Temp\arduino_build_758686 -warnings=all -build-cache C:\Users\ADMINI~1\AppData\Local\Temp\arduino_cache_867828 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\Administrator\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Administrator\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avrdude.path=C:\Users\Administrator\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -verbose C:\Users\Administrator\Downloads\Periodic_table_of_elements\Periodic_table_of_elements.ino

C:\Program Files\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files\Arduino\hardware -hardware C:\Users\Administrator\AppData\Local\Arduino15\packages -tools C:\Program Files\Arduino\tools-builder -tools C:\Program Files\Arduino\hardware\tools\avr -tools C:\Users\Administrator\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files\Arduino\libraries -libraries C:\Users\Administrator\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10804 -build-path C:\Users\ADMINI~1\AppData\Local\Temp\arduino_build_758686 -warnings=all -build-cache C:\Users\ADMINI~1\AppData\Local\Temp\arduino_cache_867828 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\Administrator\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Administrator\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avrdude.path=C:\Users\Administrator\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -verbose C:\Users\Administrator\Downloads\Periodic_table_of_elements\Periodic_table_of_elements.ino

Using board 'uno' from platform in folder: C:\Users\Administrator\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21

Using core 'arduino' from platform in folder: C:\Users\Administrator\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21

Detecting libraries used...

"C:\Users\Administrator\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10804 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Users\Administrator\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\Administrator\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\standard" "C:\Users\ADMINI~1\AppData\Local\Temp\arduino_build_758686\sketch\Periodic_table_of_elements.ino.cpp" -o "nul"

"C:\Users\Administrator\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10804 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Users\Administrator\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\Administrator\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\standard" "C:\Users\ADMINI~1\AppData\Local\Temp\arduino_build_758686\sketch\Periodic_table_of_elements.ino.cpp" -o "C:\Users\ADMINI~1\AppData\Local\Temp\arduino_build_758686\preproc\ctags_target_for_gcc_minus_e.cpp"

C:\Users\Administrator\Downloads\Periodic_table_of_elements\Periodic_table_of_elements.ino:1:40: fatal error: U8glib.h: No such file or directory

#include "U8glib.h"//寮曠敤U8G澶存枃浠?

^

compilation terminated.

exit status 1

为开发板 Arduino/Genuino Uno 编译时出错。

代码:

#include "U8glib.h"//引用U8G头文件

U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);//设置设备名称:I2C-SSD1306-128*64(OLED)

//如果屏幕不同请自行修改 如果第一次使用u8glib并且遇到显示不正确,请自行修改u8g配置

/*=========================================================

位图

=========================================================*/

//HWT

const uint8_t HWT[] PROGMEM = {0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x06, 0x33, 0x3c, 0x12, 0x8b, 0xe0, 0x89, 0x44, 0x42, 0x09, 0x49, 0x24, 0x12, 0x88, 0x80, 0x89, 0x44, 0x99, 0x02, 0x49, 0x3c, 0x1e, 0x88, 0x8c, 0x8f, 0x44, 0x99, 0x04, 0x49, 0x24, 0x12, 0xa8, 0x8c, 0x89, 0x54, 0x42, 0x08, 0x49, 0x24, 0x12, 0x50, 0x80, 0x89, 0x28, 0x66, 0x0f, 0x33, 0xbc, 0x12, 0x50, 0x80, 0xe9, 0x28, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

//title

const uint8_t title[] PROGMEM = {0x00, 0x00, 0x00, 0x08, 0x00, 0x3f, 0xff, 0x02, 0x30, 0x00, 0x00, 0x80, 0x00, 0x3f, 0xfc, 0x03, 0xff, 0xf0, 0x3f, 0xff, 0x02, 0x33, 0xf8, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x30, 0x83, 0x0f, 0xfb, 0x18, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x30, 0x83, 0x07, 0x33, 0x18, 0x00, 0x80, 0x00, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x37, 0xf3, 0x02, 0x33, 0x18, 0x3f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x30, 0x83, 0x03, 0xf3, 0xf8, 0x3f, 0xfe, 0x00, 0x7f, 0xff, 0x0f, 0xff, 0xf8, 0x21, 0xc3, 0x02, 0x33, 0x18, 0x00, 0x80, 0x00, 0x06, 0x20, 0x00, 0x31, 0x80, 0x2f, 0xfb, 0x03, 0x33, 0x18, 0xff, 0xff, 0x80, 0x06, 0x20, 0x01, 0xff, 0x80, 0x20, 0x03, 0x03, 0xf3, 0x18, 0x03, 0x40, 0x00, 0x06, 0x20, 0x01, 0xfe, 0x40, 0x27, 0xf3, 0x02, 0x33, 0xf8, 0x06, 0xc2, 0x00, 0x06, 0x20, 0x00, 0x38, 0x60, 0x26, 0x33, 0x0f, 0xfb, 0x18, 0x0e, 0x46, 0x00, 0x04, 0x20, 0x03, 0xff, 0xf0, 0x66, 0x33, 0x0f, 0xfb, 0x18, 0x3e, 0x7c, 0x00, 0x0c, 0x20, 0x03, 0x0c, 0x00, 0x66, 0x33, 0x02, 0x23, 0x18, 0x76, 0x38, 0x00, 0x18, 0x21, 0x80, 0xcc, 0xc0, 0x67, 0xf3, 0x06, 0x36, 0x18, 0x46, 0xd8, 0x00, 0x38, 0x31, 0x87, 0x8c, 0x70, 0x40, 0x03, 0x0c, 0x1e, 0x18, 0x07, 0x8f, 0x80, 0xf0, 0x3f, 0x06, 0x3c, 0x30, 0xc0, 0x1f, 0x08, 0x0c, 0x38, 0x07, 0x03, 0x80, 0x40, 0x00, 0x00, 0x10, 0x00, 0x40, 0x0e, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00};

//放射性

const uint8_t radiation[] PROGMEM = {0x00, 0x00, 0x0f, 0xf0, 0x1f, 0xe8, 0x27, 0xe4, 0x43, 0xc2, 0x43, 0x82, 0x03, 0x80, 0x02, 0x40, 0x7e, 0x7e, 0x7f, 0xfe, 0x7c, 0x7e, 0x7c, 0x3e, 0x38, 0x1c, 0x18, 0x18, 0x0c, 0x30, 0x00, 0x00};

//金属

const uint8_t Bmrtal[] PROGMEM = {0x00, 0x00, 0x03, 0xfe, 0x04, 0x06, 0x08, 0x0a, 0x10, 0x12, 0x3f, 0xe2, 0x20, 0x22, 0x20, 0x22, 0x20, 0x22, 0x60, 0x22, 0xa0, 0x24, 0x60, 0x29, 0xa0, 0x3a, 0x7f, 0xf5, 0xaa, 0xaa, 0x55, 0x54};

const uint8_t Element[] PROGMEM = {0x7f, 0xc0, 0x10, 0x01, 0x00, 0x1c, 0x80, 0x00, 0x00, 0x10, 0x03, 0xfc, 0x38, 0x80, 0x00, 0x01, 0xff, 0x02, 0x08, 0x09, 0x98, 0x00, 0x00, 0x10, 0x0d, 0x90, 0x3f, 0x18, 0xff, 0xc3, 0xff, 0x80, 0xe0, 0x18, 0x40, 0x1a, 0x00, 0xfe, 0x00, 0xc0, 0x18, 0x40, 0x12, 0x00, 0x33, 0x03, 0xfc, 0x1d, 0x50, 0x12, 0x01, 0xff, 0x8f, 0x04, 0x39, 0x48, 0x32, 0x00, 0x10, 0x01, 0x04, 0x2b, 0x48, 0x63, 0x21, 0x93, 0x01, 0xfc, 0x0a, 0x40, 0xc1, 0xe2, 0x30, 0x01, 0x04, 0x08, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

//元素名称

const uint8_t Relative[] PROGMEM = {0x7f, 0xe1, 0xff, 0x04, 0x40, 0x0b, 0xf0, 0x42, 0x00, 0x06, 0x06, 0x4c, 0x10, 0x30, 0x5f, 0xc0, 0x08, 0x02, 0x58, 0x34, 0x20, 0x50, 0x40, 0x10, 0x00, 0x40, 0x0c, 0xe0, 0x5f, 0xc0, 0x10, 0x0f, 0xfe, 0x1b, 0x18, 0x50, 0x43, 0xff, 0x80, 0x40, 0x3a, 0x00, 0x5f, 0xc0, 0x10, 0x00, 0x40, 0x2b, 0xf8, 0x42, 0x00, 0x10, 0x0f, 0xfe, 0x08, 0x40, 0x4a, 0xc0, 0x10, 0x00, 0x40, 0x08, 0x40, 0x92, 0x60, 0x10, 0x00, 0x40, 0x08, 0x40, 0xa6, 0x00, 0x70, 0x00, 0x40, 0x1f, 0xf8};

//相对质量

const uint8_t RM[] PROGMEM = {0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0xf0, 0x00, 0x81, 0xfe, 0x0f, 0xf8, 0x12, 0x11, 0xf0, 0x83, 0xb0, 0x0f, 0xf8, 0x7e, 0x10, 0x3f, 0xc3, 0xff, 0x0f, 0xf8, 0x33, 0xf0, 0x37, 0xc3, 0xfe, 0x18, 0x0c, 0x33, 0x11, 0xa0, 0x82, 0x30, 0x1f, 0xfc, 0x3e, 0x10, 0xec, 0x82, 0xfe, 0x0f, 0xf8, 0x77, 0xf0, 0x64, 0x82, 0x92, 0x0f, 0xf8, 0x52, 0x10, 0x64, 0x82, 0x92, 0x0f, 0xf8, 0x12, 0x10, 0xb0, 0x86, 0x3c, 0x00, 0x80, 0x13, 0xf1, 0x90, 0x86, 0x6e, 0x07, 0xf0, 0x13, 0x11, 0x03, 0x85, 0xc3, 0x1f, 0xfc};

//价态

const uint8_t VA[] PROGMEM = {0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xc0, 0x08, 0x01, 0xfc, 0x04, 0x38, 0x11, 0x80, 0x18, 0x00, 0x1f, 0xc1, 0xff, 0xc1, 0xfc, 0x09, 0xa0, 0x11, 0x81, 0xff, 0xc0, 0x10, 0x40, 0x7f, 0x01, 0x04, 0x09, 0x20, 0x22, 0x40, 0x14, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x19, 0x20, 0x26, 0x30, 0x22, 0x00, 0x7f, 0xf0, 0x7f, 0x07, 0xff, 0x19, 0xfc, 0x6c, 0x10, 0x73, 0x00, 0x24, 0x00, 0x00, 0x02, 0x40, 0x09, 0x20, 0x22, 0x41, 0x88, 0xc0, 0x3f, 0xe1, 0x00, 0x43, 0xfe, 0x09, 0x20, 0x22, 0x41, 0x00, 0x00, 0x3d, 0x41, 0x3e, 0x43, 0xd4, 0x09, 0x30, 0x22, 0x40, 0xac, 0x80, 0x26, 0xc1, 0x22, 0x42, 0x6c, 0x09, 0xd0, 0x22, 0x41, 0xa0, 0xc0, 0x7c, 0xc1, 0x3e, 0x47, 0xcc, 0x09, 0xdc, 0x24, 0x41, 0x21, 0x40, 0x05, 0x31, 0x00, 0xc0, 0x53, 0x08, 0x4c, 0x2c, 0x40, 0x3f, 0x00};

/*=========================================================

自定义按键

=========================================================*/

#define UP 11//定义方向键上为Arduino上的11号引脚

#define DOWN 10//定义方向键上为Arduino上的10号引脚

#define LEFT 9//定义方向键上为Arduino上的9号引脚

#define RIGHT 8//定义方向键上为Arduino上的8号引脚

#define A 7//定义方向键上为Arduino上的7号引脚

#define B 6//定义方向键上为Arduino上的6号引脚

/*=========================================================

变量

=========================================================*/

boolean metal;

boolean refresh = true;

byte EX = 0;

byte EY = 0; //当前显示位置

int Nx, Ny;

byte ZQ; //周期

byte x, y;

const  byte AM[10][18] PROGMEM = {  //排列方式

{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2},

{3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 7, 8, 9, 10},

{11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 56, 0, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86},

{87, 88, 0, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118},

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{0, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 0, 0},

{0, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 0, 0}

};

const byte non[24] PROGMEM = {  //非金属

1, 2,

5, 6, 7, 8, 9, 10,

14, 15, 16, 17, 18,

33, 34, 33, 36,

52, 53, 54,

85, 86,

117, 118,

};

const byte Radius[107] PROGMEM = {  //半径

78, 100, 154, 113, 95, 86, 80, 66, 64, 100,

191, 160, 143, 134, 130, 104, 162, 100, 234, 197, 164,

145, 135, 127, 132, 127, 126, 124, 128, 139, 140, 140,

150, 160, 111, 114, 250, 215, 180, 160, 148, 140, 135,

132, 134, 137, 144, 157, 166, 158, 160, 170, 195, 133,

271, 224, 184, 182, 183, 182, 163, 180, 204, 180, 178,

177, 177, 176, 175, 194, 173, 159, 148, 141, 146, 134,

136, 139, 144, 162, 173, 175, 170, 170, 153, 153, 153,

153, 188, 180, 160, 155, 158, 164, 173, 142, 142, 142,

142, 142, 142, 142, 142, 142, 142, 142, 142,

};

const byte mass[] PROGMEM = {  //相对质量

10, 8, 40, 3, 69, 41, 90, 12, 10, 81, 12, 1, 14, 1,

16, 0, 19, 00, 20, 18, 22, 99, 24, 31, 26, 98, 23, 9,

30, 97, 32, 6, 35, 45, 39, 95, 39, 10, 40, 8, 44, 96,

47, 87, 50, 94, 52, 0, 54, 94, 55, 85, 58, 93, 58, 69,

63, 55, 65, 38, 69, 72, 72, 63, 74, 92, 78, 96, 79, 90,

83, 80, 85, 47, 87, 62, 88, 91, 91, 22, 92, 91, 95, 96,

98, 0, 10, 11, 10, 29, 10, 64, 10, 79, 11, 24, 11, 48,

11, 87, 12, 18, 12, 76, 12, 69, 13, 13, 13, 29, 13, 73,

13, 89, 14, 1, 14, 9, 14, 42, 14, 50, 15, 4, 15, 20,

15, 73, 15, 89, 16, 25, 16, 49, 16, 73, 16, 89, 17, 31,

17, 50, 17, 85, 18, 9, 18, 38, 18, 62, 19, 2, 19, 22,

19, 51, 19, 70, 20, 6, 20, 44, 20, 72, 20, 90, 20, 90,

21, 0, 22, 20, 22, 30, 22, 60, 22, 70, 23, 20, 23, 10,

23, 80, 23, 70, 24, 40, 24, 30, 24, 70, 24, 70, 25, 10,

25, 20, 25, 70, 25, 80, 25, 90, 26, 20, 26, 50, 26, 80,

27, 10, 27, 00, 27, 70, 27, 60, 28, 10, 28, 00, 28, 50,

28, 40, 28, 90, 28, 80, 29, 30, 29, 40, 29, 40, 30,

};

const  byte AC[118][7] PROGMEM = {  //结构

{1, 0, 0, 0, 0, 0, 0},

{2, 0, 0, 0, 0, 0, 0},

{2, 1, 0, 0, 0, 0, 0},

{2, 2, 0, 0, 0, 0, 0},

{2, 3, 0, 0, 0, 0, 0},

{2, 4, 0, 0, 0, 0, 0},

{2, 5, 0, 0, 0, 0, 0},

{2, 6, 0, 0, 0, 0, 0},

{2, 7, 0, 0, 0, 0, 0},

{2, 8, 0, 0, 0, 0, 0},

{2, 8, 1, 0, 0, 0, 0},

{2, 8, 2, 0, 0, 0, 0},

{2, 8, 3, 0, 0, 0, 0},

{2, 8, 4, 0, 0, 0, 0},

{2, 8, 5, 0, 0, 0, 0},

{2, 8, 6, 0, 0, 0, 0},

{2, 8, 7, 0, 0, 0, 0},

{2, 8, 8, 0, 0, 0, 0}, //18

{2 , 8 , 8 , 1, 0, 0, 0},

{2 , 8 , 8 , 2, 0, 0, 0},

{2 , 8 , 9 , 2, 0, 0, 0},

{2 , 8 , 10 , 2, 0, 0, 0},

{2 , 8 , 11 , 2, 0, 0, 0},

{2 , 8 , 13 , 1, 0, 0, 0},

{2 , 8 , 13 , 2, 0, 0, 0},

{2 , 8 , 14 , 2, 0, 0, 0},

{2 , 8 , 15 , 2, 0, 0, 0},

{2 , 8 , 16 , 2, 0, 0, 0},

{2 , 8 , 18 , 1, 0, 0, 0},

{2 , 8 , 18 , 2, 0, 0, 0},

{2 , 8 , 18 , 3, 0, 0, 0},

{2 , 8 , 18 , 4, 0, 0, 0},

{2 , 8 , 18 , 5, 0, 0, 0},

{2 , 8 , 18 , 6, 0, 0, 0},

{2 , 8 , 18 , 7, 0, 0, 0},

{2 , 8 , 18 , 8, 0, 0, 0,},

{2 , 8 , 18 , 8 , 1, 0, 0},

{2 , 8 , 18 , 8 , 2, 0, 0},

{2 , 8 , 18 , 9 , 2, 0, 0},

{2 , 8 , 18 , 10, 2, 0, 0},

{2 , 8 , 18 , 12, 1, 0, 0},

{2 , 8 , 18 , 13, 1, 0, 0},

{2 , 8 , 18 , 13, 2, 0, 0},

{2 , 8 , 18 , 15, 1, 0, 0},

{2 , 8 , 18 , 16, 1, 0, 0},

{2 , 8 , 18 , 18 , 0, 0, 0},

{2 , 8 , 18 , 18 , 1 , 0, 0},

{2 , 8 , 18 , 18 , 2 , 0, 0},

{2 , 8 , 18 , 18 , 3 , 0, 0},

{2 , 8 , 18 , 18 , 4 , 0, 0},

{2 , 8 , 18 , 18 , 5 , 0, 0},

{2 , 8 , 18 , 18 , 6 , 0, 0},

{2 , 8 , 18 , 18 , 7 , 0, 0},

{2 , 8 , 18 , 18 , 8 , 0, 0},

{2 , 8 , 18 , 18 , 8 , 1, 0},

{2 , 8 , 18 , 18 , 8 , 2, 0},

{2 , 8 , 18 , 18 , 9 , 2, 0},

{2 , 8 , 18 , 19 , 9 , 2, 0},

{2 , 8 , 18 , 21 , 8 , 2, 0},

{2 , 8 , 18 , 22 , 8 , 2, 0},

{2 , 8 , 18 , 23 , 8 , 2, 0},

{2 , 8 , 18 , 24 , 8 , 2, 0},

{2 , 8 , 18 , 25 , 8 , 2, 0},

{2 , 8 , 18 , 25 , 9 , 2, 0},

{2 , 8 , 18 , 27 , 8 , 2, 0},

{2 , 8 , 18 , 28 , 8 , 2, 0},

{2 , 8 , 18 , 29 , 8 , 2, 0},

{2 , 8 , 18 , 30 , 8 , 2, 0},

{2 , 8 , 18 , 31 , 8 , 2, 0},

{2 , 8 , 18 , 32 , 8 , 2, 0},

{2 , 8 , 18 , 32 , 9 , 2, 0},

{2 , 8 , 18 , 32 , 10, 2, 0}, //72

{2 , 8 , 18 , 32 , 11, 2 , 0},

{2 , 8 , 18 , 32 , 12, 2 , 0},

{2 , 8 , 18 , 32 , 13, 2 , 0},

{2 , 8 , 18 , 32 , 14, 2 , 0},

{2 , 8 , 18 , 32 , 15, 2 , 0},

{2 , 8 , 18 , 32 , 17, 1 , 0},

{2 , 8 , 18 , 32 , 18, 1 , 0},

{2 , 8 , 18 , 32 , 18, 2 , 0},

{2 , 8 , 18 , 32 , 18, 3 , 0},

{2 , 8 , 18 , 32 , 18, 4 , 0},

{2 , 8 , 18 , 32 , 18, 5 , 0},

{2 , 8 , 18 , 32 , 18, 6 , 0},

{2 , 8 , 18 , 32 , 18, 7 , 0},

{2 , 8 , 18 , 32 , 18, 8 , 0},

{2 , 8 , 18 , 32 , 18, 8 , 1},

{2 , 8 , 18 , 32 , 18, 8 , 2},

{2 , 8 , 18 , 32 , 18, 9 , 2},

{2 , 8 , 18 , 32 , 18, 10, 2},

{2 , 8 , 18 , 32 , 20, 9 , 2},

{2 , 8 , 18 , 32 , 21, 9 , 2},

{2 , 8 , 18 , 32 , 22, 9 , 2},

{2 , 8 , 18 , 32 , 24, 8 , 2},

{2 , 8 , 18 , 32 , 25, 8 , 2},

{2 , 8 , 18 , 32 , 25, 9 , 2},

{2 , 8 , 18 , 32 , 27, 8 , 2},

{2 , 8 , 18 , 32 , 28, 8 , 2},

{2 , 8 , 18 , 32 , 29, 8 , 2},

{2 , 8 , 18 , 32 , 30, 8 , 2},

{2 , 8 , 18 , 32 , 31, 8 , 2},

{2 , 8 , 18 , 32 , 32, 8 , 2},

{2 , 8 , 18 , 32 , 32, 9 , 2},

{2 , 8 , 18 , 32 , 32, 10, 2},

{2 , 8 , 18 , 32 , 32, 11, 2},

{0, 0, 0, 0, 0, 0, 0,},

{0, 0, 0, 0, 0, 0, 0,},

{0, 0, 0, 0, 0, 0, 0,}

};

//元素名称

const byte EN[354] PROGMEM = {72, 32, 32, 72, 101, 32, 76, 105, 32, 66, 101, 32, 66, 32, 32, 67, 32, 32, 78, 32, 32, 79, 32, 32, 70, 32, 32, 78, 101, 32, 78, 97, 32, 77, 103, 32, 65, 108, 32, 83, 105, 32, 80, 32, 32, 83, 32, 32, 67, 108, 32, 65, 114, 32, 75, 32, 32, 67, 97, 32, 83, 99, 32, 84, 105, 32, 86, 32, 32, 67, 114, 32, 77, 110, 32, 70, 101, 32, 67, 111, 32, 78, 105, 32, 67, 117, 32, 90, 110, 32, 71, 97, 32, 71, 101, 32, 65, 115, 32, 83, 101, 32, 66, 114, 32, 75, 114, 32, 82, 98, 32, 83, 114, 32, 89, 32, 32, 90, 114, 32, 78, 98, 32, 77, 111, 32, 84, 99, 42, 82, 117, 32, 82, 104, 32, 80, 100, 32, 65, 103, 32, 67, 100, 32, 73, 110, 32, 83, 110, 32, 83, 98, 32, 84, 101, 32, 73, 32, 32, 88, 101, 32, 67, 115, 32, 66, 97, 32, 76, 97, 32, 67, 101, 32, 80, 114, 32, 78, 100, 32, 80, 109, 32, 83, 109, 32, 69, 117, 32, 71, 100, 32, 84, 98, 32, 68, 121, 32, 72, 111, 32, 69, 114, 32, 84, 109, 32, 89, 98, 32, 76, 117, 32, 72, 102, 32, 84, 97, 32, 87, 32, 32, 82, 101, 32, 79, 115, 32, 73, 114, 32, 80, 116, 32, 65, 117, 32, 72, 103, 32, 84, 105, 32, 80, 98, 32, 66, 105, 32, 80, 111, 42, 65, 116, 42, 82, 110, 42, 70, 114, 42, 82, 97, 42, 65, 99, 42, 84, 104, 42, 80, 97, 42, 85, 32, 42, 78, 112, 42, 80, 117, 42, 65, 109, 42, 67, 109, 42, 66, 107, 42, 67, 102, 42, 69, 115, 42, 70, 109, 42, 77, 100, 42, 78, 111, 42, 76, 114, 42, 82, 102, 42, 68, 98, 42, 83, 103, 42, 66, 104, 42, 72, 115, 42, 77, 116, 42, 68, 115, 42, 82, 103, 42, 67, 110, 42, 78, 104, 42, 70, 108, 42, 77, 101, 42, 76, 118, 42, 84, 115, 42, 79, 103, 42,};

/*=========================================================

只循环一次

=========================================================*/

void setup() {

//串口通讯波特率设置

//初始化按钮

pinMode(UP, INPUT);//定义方向UP引脚状态

pinMode(DOWN, INPUT);//定义方向DOWN引脚状态

pinMode(LEFT, INPUT);//定义方向LEFT引脚状态

pinMode(RIGHT, INPUT);//定义方向RIGHT引脚状态

pinMode(A, INPUT);//定义按键A引脚状态

pinMode(B, INPUT);//定义按键B引脚状态

//启动动画

for (int i = 63; i >= 46; i--) {

u8g.firstPage();

do {

u8g.drawBitmapP(26, i, 9, 8, HWT);

if (i == 46) u8g.drawBitmapP(15, 9, 13, 17, title);

} while ( u8g.nextPage() );

}

delay(1000);

}

/*=========================================================

不停循环

=========================================================*/

void loop() {

/*=========================================================

按键输入

=========================================================*/

if (digitalRead(UP) == HIGH) {

if (EY > 0) {

EY--;

refresh = true;

}

}

if (digitalRead(DOWN) == HIGH) {

if (EY < 9) {

EY++;

refresh = true;

}

}

if (digitalRead(LEFT) == HIGH) {

if (EX > 0) {

EX--;

refresh = true;

}

}

if (digitalRead(RIGHT) == HIGH) {

if (EX < 17) {

EX++;

refresh = true;

}

}

if (digitalRead(A) == HIGH) {

if (pgm_read_byte_near(&AM[EY][EX]) != 0) {

refresh = true;

show();

} else {

if (EX == 2 && EY == 5) {

EX = 1;

EY = 8;

refresh = true;

}

if (EX == 2 && EY == 6) {

EX = 1;

EY = 9;

refresh = true;

}

delay(200); //防止按键短时间触发两遍

}

}

/*=========================================================

显示

=========================================================*/

if (refresh == true) {

u8g.firstPage();

do {

DrawTable();

} while ( u8g.nextPage() );

refresh = false;

}

}

/*=========================================================

渲染表格

=========================================================*/

void DrawTable() {

Nx = EX - 3;

Ny = EY - 1;

for (int y = 1; y <= 3; y++) {

for (int x = 1; x <= 7; x++) {

if (x == 4 && y == 2) {

//处于选择位置 反色处理开始

u8g.setColorIndex(1);

u8g.drawBox(x * 16 - 1, y * 16 - 1, 17, 17); //白色背景

u8g.setColorIndex(0);

}

if (Nx >= 0 && Ny >= 0 && Nx <= 17 && Ny <= 9) {

u8g.setFont(u8g_font_u8glib_4);   //切换u8g_font_u8glib_4字体

if (pgm_read_byte_near(&AM[Ny][Nx]) != 0) { //如果当前位置存在元素

if (x == 4 && y == 2) {} else {

u8g.drawFrame(x * 16 - 1, y * 16 - 1, 17, 17);  //画格子

}

u8g.setPrintPos(x * 16 + 1, y * 16 + 6);  //在坐标开始画

u8g.print(pgm_read_byte_near(&AM[Ny][Nx]));   //原子序号

//元素名称

u8g.setPrintPos(x * 16 + 1, y * 16 + 6 + 8); //在坐标开始画 第1个字符

u8g.print((char)pgm_read_byte_near(&EN[(3 * pgm_read_byte_near(&AM[Ny][Nx])) - 3])); //元素名称

u8g.setPrintPos(x * 16 + 1 + 5, y * 16 + 6 + 8); //在坐标开始画 第2个字符

u8g.print((char)pgm_read_byte_near(&EN[(3 * pgm_read_byte_near(&AM[Ny][Nx])) - 2])); //元素名称

u8g.setPrintPos(x * 16 + 1 + 5 + 5, y * 16 + 6 + 8); //在坐标开始画 第3个字符

u8g.print((char)pgm_read_byte_near(&EN[(3 * pgm_read_byte_near(&AM[Ny][Nx])) - 1])); //元素名称

} else {

//判断是否为镧系和锕系

if (Nx == 2 && Ny == 5) {

if (x == 4 && y == 2) {} else {

u8g.drawFrame(x * 16 - 1, y * 16 - 1, 17, 17);  //画格子

}

u8g.setPrintPos(x * 16 + 1, y * 16 + 10);  //在坐标开始画

u8g.print("La X");

} else {

if (Nx == 2 && Ny == 6) {

if (x == 4 && y == 2) {} else {

u8g.drawFrame(x * 16 - 1, y * 16 - 1, 17, 17);  //画格子

}

u8g.setPrintPos(x * 16 + 1, y * 16 + 10);  //在坐标开始画

u8g.print("Ac X");

} else {

//画背景

u8g.drawLine(x * 16 + 3, y * 16 + 3, x * 16 + 12, y * 16 + 12);

u8g.drawLine(x * 16 + 12, y * 16 + 3, x * 16 + 3, y * 16 + 12);

}

}

}

if (x == 4 && y == 2) {

//处于选择位置 反色处理结束

u8g.setColorIndex(1);

}

}

Nx++;

}

//画周期

if (Ny + 1 <= 7 && Ny + 1 > 0) {

u8g.setFont(u8g_font_courB08);   //切换u8g_font_courB08字体

u8g.setPrintPos(3, y * 16 + 11); //在坐标开始画

u8g.print(Ny + 1);

}

Nx = EX - 3;

Ny++;

}

if (EY <= 7) { //在镧系和锕系关闭族的显示

//画族

u8g.setFont(u8g_font_u8glib_4);   //切换u8g_font_u8glib_4字体

u8g.setPrintPos(69 - EX * 16, 6); //在坐标开始画

u8g.print(F("IA    IIA   IIIB  IVB   VB  VIB VIIB  VIII  VIII  VIII    IB    IIB   IIIA   IVA  VA"));

if (EX >= 12) {

//清除渲染错误区域

u8g.setColorIndex(0);

u8g.drawBox(64 - EX * 16, 0, 112, 14); //清空重绘区

u8g.setColorIndex(1);

//绘后半部分

u8g.setPrintPos(48 - EX * 16, 6); //在坐标开始画

u8g.print(F(" VIA  VIIA   0 "));

}

if (EX <= 3) {

//清除渲染错误区域

u8g.setColorIndex(0);

u8g.drawBox(0, 0, 48 - EX * 16, 14); //清空重绘区

u8g.setColorIndex(1);

}

}

}

/*=========================================================

详细资料

=========================================================*/

void show() {

byte p = 1;

while (digitalRead(B) == LOW)

{

if (digitalRead(LEFT) == HIGH) {

if (p > 1) {

p--;

refresh = true;

}

}

if (digitalRead(RIGHT) == HIGH) {

if (p < 3) {

p++;

refresh = true;

}

}

if (refresh == true) {

refresh = false;

u8g.firstPage();

do {

if (p == 1) {

//资料页

u8g.setFont(u8g_font_10x20);

u8g.setPrintPos(60, 14);

u8g.print((char)pgm_read_byte_near(&EN[(3 * pgm_read_byte_near(&AM[EY][EX])) - 3])); //元素名称

u8g.setPrintPos(74, 14);

u8g.print((char)pgm_read_byte_near(&EN[(3 * pgm_read_byte_near(&AM[EY][EX])) - 2])); //元素名称

u8g.setPrintPos(92, 14);

//是否放射性

if (pgm_read_byte_near(&EN[(3 * pgm_read_byte_near(&AM[EY][EX])) - 1]) == 42) u8g.drawBitmapP(112, 19, 2, 16, radiation); //放射性图标

//是否金属

metal = true;

for (int i = 0; i <= 23; i++) {

if (pgm_read_byte_near(&non[i]) == pgm_read_byte_near(&AM[EY][EX])) {

metal = false;

}

}

if (metal == true) u8g.drawBitmapP(112, 36, 2, 16, Bmrtal); //金属图标

u8g.print(pgm_read_byte_near(&AM[EY][EX]));   //原子序数

u8g.setFont(u8g_font_tpssb);

u8g.drawBitmapP(2, 1, 7, 11, Element);

u8g.drawBitmapP(2, 21, 7, 11, Relative);

u8g.drawBitmapP(1, 40, 7, 12, RM);

u8g.setPrintPos(61, 30);

if (pgm_read_byte_near(&AM[EY][EX]) < 108) {

u8g.print(float(pgm_read_byte_near(&Radius[pgm_read_byte_near(&AM[EY][EX]) - 1])) / 100); //半径

} else {

u8g.print("?.???");

}

u8g.setPrintPos(61, 52);

if (pgm_read_byte_near(&AM[EY][EX]) <= 4) {

u8g.print(pgm_read_byte_near(&mass[2 * pgm_read_byte_near(&AM[EY][EX]) - 2]) / float(10) + pgm_read_byte_near(&mass[2 * pgm_read_byte_near(&AM[EY][EX]) - 1]) / float(1000), 3); //相对质量

} else {

if (pgm_read_byte_near(&AM[EY][EX]) <= 43) {

u8g.print(pgm_read_byte_near(&mass[2 * pgm_read_byte_near(&AM[EY][EX]) - 2]) + pgm_read_byte_near(&mass[2 * pgm_read_byte_near(&AM[EY][EX]) - 1]) / float(100), 2); //相对质量

} else {

u8g.print(pgm_read_byte_near(&mass[2 * pgm_read_byte_near(&AM[EY][EX]) - 2]) * 10 + pgm_read_byte_near(&mass[2 * pgm_read_byte_near(&AM[EY][EX]) - 1]) / float(10), 1); //相对质量

}

}

u8g.drawLine(0, 35, 128, 35);

u8g.drawLine(0, 17, 128, 17);

} else {

if (p == 2) {

//结构页

//计算原子层数

if (EY <= 7) {

ZQ = EY;

} else {

if (EY == 8) {

ZQ = 5;

} else {

if (EY == 9) {

ZQ = 6;

}

}

}

//46号不规则

if (pgm_read_byte_near(&AM[EY][EX]) == 46) ZQ = 3;

u8g.setFont(u8g_font_tpssb);

u8g.drawDisc(11, 30, 16);  //画实心圆

for (int i = 1; i <= ZQ + 1; i++) {

u8g.drawCircle(11, 30, 12 + i * 15);   //渲染运行轨道

}

u8g.setColorIndex(0);

//原子序数

u8g.setPrintPos(-2, 35);

u8g.print("+");

u8g.setPrintPos(6, 35);

u8g.print(pgm_read_byte_near(&AM[EY][EX]));

u8g.drawBox(29, 26, 95, 13); //清理轨道

u8g.setColorIndex(1);

//标上电子数

u8g.setFont(u8g_font_blipfest_07);

for (int i = 0; i <= ZQ; i++) {

u8g.setPrintPos(39 + i * 14, 34);

if (pgm_read_byte_near(&AM[EY][EX]) < 105) {

u8g.print(pgm_read_byte_near(&AC[pgm_read_byte_near(&AM[EY][EX]) - 1][i]));

} else {

u8g.print("?");

}

}

} else {

if (p == 3) {

u8g.setFont(u8g_font_10x20);

u8g.drawBitmapP(22, 1, 11, 12, VA);

u8g.drawBox(0, 16, 128, 1);

u8g.drawBox(64, 16, 1, 128);

u8g.setPrintPos(16, 34);

u8g.print("Max");

u8g.setPrintPos(85, 34);

u8g.print("Min");

u8g.setPrintPos(27, 51);

u8g.print(pgm_read_byte_near(&AC[pgm_read_byte_near(&AM[EY][EX]) - 1][ZQ]));   //打印最外层电子

u8g.setPrintPos(95, 51);

if (metal == true) {

//金属没有负假

u8g.print("0");

} else {

if (pgm_read_byte_near(&AC[pgm_read_byte_near(&AM[EY][EX]) - 1][ZQ]) >= 4 && (pgm_read_byte_near(&AC[pgm_read_byte_near(&AM[EY][EX]) - 1][ZQ]) != 8)) {

u8g.print(8 - pgm_read_byte_near(&AC[pgm_read_byte_near(&AM[EY][EX]) - 1][ZQ]));

u8g.setPrintPos(80, 51);

u8g.print("-");

} else {

u8g.print("0");

}

}

}

}

}

} while ( u8g.nextPage() );

}

}

refresh = true;  //返回后进行画面刷新

}

2.png

(44.94 KB, 下载次数: 33)

2018-4-21 08:43 上传

1.png

(60.24 KB, 下载次数: 32)

2018-4-21 08:43 上传

arduino编译失败_Arduino编译时失败相关推荐

  1. oracle net config失败,安装配置时失败,[INS-20802] Oracle Net Configuration Assistant 失败。...

    源自:1-2 Oracle安装 安装配置时失败,[INS-20802] Oracle Net Configuration Assistant 失败. 信息: ConfigClient.assignAc ...

  2. arduino编译失败_arduino 编译 错误,求大神

    Arduino:1.8.2 (Windows 7), 开发板:"ATmega8-noxtal @8MHz" D:\softwareinstallation\Arduino\ardu ...

  3. ubuntu1604编译android5.1(android L)失败error: unsupportedreloc 43等问题

    ubuntu1604编译android5.1(android L)失败error: unsupportedreloc 43等问题 1.    编译的问题 见session_root1 prebuilt ...

  4. VC++ MFC单文档应用程序SDI下调用glGenBuffersARB(1, pbo)方法编译通过但执行时出错原因分析及解决办法:glewInit()初始化的错误...

    1.问题症状 在VC++环境下,利用MFC单文档应用程序SDI下开发OpenGL程序,当调用glGenBuffersARB(1, &pbo)方法编译通过但执行时出错,出错代码如下: OpenG ...

  5. eCos编译Synthethic Target程序时无法解析__sprintf_chk的解决办法

    mingdu.zheng <at> gmail <dot> com http://blog.csdn.net/zoomdy/article/details/10615853 官 ...

  6. JPA 2.0 中的动态类型安全查询(如何通过 Criteria API 构建动态查询并减少运行时失败)...

    简介:  如果编译器能够对查询执行语法正确性检查,那么对于 Java 对象而言该查询就是类型安全的.Java™Persistence API (JPA) 的 2.0 版本引入了 Criteria AP ...

  7. 解决Office互操作错误检索COML类工厂中 CLSID为 {xxx}的组件时失败,原因是出现以下错误: 80070005...

    Excel为例(其他如Word也适用)文件数据导入时报出以下错误: 检索COML类工厂中 CLSID为 {00024500-0000-0000-C000-000000000046}的组件时失败,原因是 ...

  8. 检索COM 类工厂中CLSID 为{00024500-0000-0000-C000-000000000046}组件时失败

    检索 COM 类工厂中 CLSID 为{00024500-0000-0000-C000-000000000046} 的组件时失败,原因是出现以下错误: 80070005 当在ASP.NET应用程序中引 ...

  9. mysql 启动安全模式_“ Word上次启动时失败,以安全模式启动Word ....”解决办法...

    " Word上次启动时失败,以安全模式启动Word ...."解决办法  Word上次启动时失败,以安全模式启动word将帮助您纠正或发现启动中的问题,下一次成功启动应用程序.但是 ...

最新文章

  1. VMware ESXi 中的 CentOS 硬盘扩容
  2. 腾讯、阿里到底有多缺这类程序员?
  3. 第十三章:位图(五)
  4. java同步锁如何使用_java 同步锁(synchronized)的正确使用姿势
  5. 【Python】Numpy处理.csv数据
  6. 矩形变弧度角_懒惰使人类进步:不想刷马桶,那就让马桶自己变干净丨种草机...
  7. FPGA工作笔记0001---FPGA简介-强大的逻辑资源和恐怖的IO并行处理能力
  8. win10相机打不开,qq可以正常打开:Windows 相机应用错误代码 0xA00F4288
  9. 511遇见易语言取屏幕分辨率和设置屏幕分辨率
  10. TTL转RS232电路设计
  11. Kafka 入门二 kafka的安装启动
  12. android qq分享纯图片,手机照片批量上传QQ空间一键分享省流量
  13. Weakly Supervised Instance Segmentation using Class Peak Response
  14. HTML图像和超链接及文字颜色与排版
  15. 为什么OpenCV4 “pkg-config --modversion opencv”显示“ No package ‘opencv‘ found”?解决方法!
  16. 谁还不是一个宝宝了~
  17. 利用pdf2image,将pdf文件转换成图片
  18. 【web自动化测试Robotframework开发手册—浏览器切换url和打开新页签】
  19. 03 分布式系统的技术栈
  20. 通过itextpdf操作PDF,动态向PDF文件最后一页添加图片

热门文章

  1. sql 触发器的常用语句(转)
  2. Asp.Net iframe Cookie 域 的问题!
  3. 【HibernateHibernate实体关系映射——双边的多对一、一对多关系
  4. 洛谷P1090 合并果子
  5. Python零基础学习笔记(十三)—— if 和 if-else语句...
  6. 0079-简单的循环
  7. cpu核心数的线程数
  8. CSharpGL(23)用ComputeShader实现一个简单的ParticleSimulator
  9. C语言及程序设计初步例程-37 循环嵌套
  10. 年末裁员事件背后的启示录(2)