Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <U8g2lib.h>
- #include <Wire.h>
- U8G2_SH1106_128X64_NONAME_F_HW_I2C OLED1(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
- U8G2_SH1106_128X64_NONAME_F_HW_I2C OLED2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
- void setup() {
- /*
- pinMode(9, OUTPUT);
- digitalWrite(9, 0); // default output in I2C mode for the SSD1306 test shield: set the i2c adr to 0
- */
- OLED1.setI2CAddress(0x3C * 2);//I2Cアドレスを2倍して指定する仕様
- OLED1.begin();
- OLED2.setI2CAddress(0x3D * 2);
- OLED2.begin();
- }
- void loop(void) {
- OLED1.clearBuffer();
- OLED1.setFontMode(1); // Transparent
- OLED1.setFontDirection(0);
- OLED1.setFont(u8g2_font_inb24_mf);
- OLED1.drawStr(0, 30, "1st");
- OLED1.sendBuffer();
- delay(1000);
- OLED2.clearBuffer();
- OLED2.setFontMode(1); // Transparent
- OLED2.setFontDirection(0);
- OLED2.setFont(u8g2_font_inb24_mf);
- OLED2.drawStr(0, 30, "2nd");
- OLED2.sendBuffer();
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement