2015-12-23 05:23:42 +08:00
|
|
|
#include <Arduino.h>
|
|
|
|
#include <SPI.h>
|
|
|
|
|
|
|
|
#include <U8g2lib.h>
|
|
|
|
|
2015-12-23 17:44:20 +08:00
|
|
|
//U8G2_SSD1306_128X64_NONAME_1_4W_SW_SPI u8g2(&u8g2_cb_r0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
|
|
|
//U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI u8g2(&u8g2_cb_r0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
|
|
|
//U8G2_SSD1306_128X64_NONAME_1_3W_SW_SPI u8g2(&u8g2_cb_r0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8);
|
|
|
|
U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(&u8g2_cb_r0, /* clock=*/ 13, /* data=*/ 11, /* reset=*/ 8);
|
|
|
|
//U8G2_SSD1306_128X64_NONAME_1_6800 u8g2(&u8g2_cb_r0, 13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8);
|
|
|
|
//U8G2_SSD1306_128X64_NONAME_1_8080 u8g2(&u8g2_cb_r0, 13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8);
|
2015-12-23 05:23:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setup(void) {
|
|
|
|
u8g2.begin();
|
|
|
|
}
|
|
|
|
|
|
|
|
void loop(void) {
|
|
|
|
u8g2.firstPage();
|
|
|
|
do {
|
|
|
|
u8g2.setFont(u8g2_font_ncenB14_tr);
|
|
|
|
u8g2.drawStr(0,20,"Hello World!");
|
|
|
|
} while ( u8g2.nextPage() );
|
|
|
|
delay(1000);
|
|
|
|
}
|
|
|
|
|