机智云GoKit2默认没有带OLED,手上刚好有个Nokia5110的显示屏,就直接拿过来用了。
之前刚好买了一个Arduino UNO,想体验体验Arduino,于是就把底板换成自己的Arduino。
需要拔掉WiFi模块才能下载程序,这一点比较麻烦
先分享一个Arduino Nokia5110的库
关键的代码:
static const byte DEGREES_CHAR = 1; static const byte degrees_glyph = { 0x00, 0x07, 0x05, 0x07, 0x00 }; #define NOKIA5110_DC 9 #define NOKIA5110_CE 10 #define NOKIA5110_CLK 13 #define NOKIA5110_DIN 11 #define NOKIA5110_RESET 8 static nokia5110 lcd(NOKIA5110_CLK, NOKIA5110_DIN, NOKIA5110_DC, NOKIA5110_RESET, NOKIA5110_CE); void setup() { lcd.begin(84, 48); lcd.createChar(DEGREES_CHAR, degrees_glyph); GoKit_Init(); //oled.ssd1306_init(SSD1306_SWITCHCAPVCC); //oled.drawstring(0,3," Hello World! "); //oled.display(); lcd.setCursor(0, 0); lcd.print("Hello, Gokit!"); lcd.setCursor(0, 2); lcd.print("ICKey"); lcd.setCursor(0, 4); lcd.print("--fjjjnk1234"); #if (DEBUG==1) Serial.println("GoKit init OK!"); Serial.print("freeMemory()="); Serial.println(freeMemory()); #endif }
谢谢 分享