Schupp icon

U8g test

Schupp | PRO | 11/15/23 03:41:58 PM UTC (Edited) | 0 ⭐ | 10910 👁️ | Never ⏰ | []
Arduino |

1.46 KB

|

None

|

0 👍

/

0 👎

// XIAO ESP32-C3 & SSD1306 0,96 Display NONAME
// very impotend !!! bevor upload , boot set , reset set, sound lisen ,rest release , sound lisen , boot release   
#include <Arduino.h>
#include <U8g2lib.h>
 
#define SDA_PIN D4
#define SCL_PIN D5
 
//U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ SCL_PIN, /* data=*/ SDA_PIN);   // ESP32 Thing, HW I2C with pin remapping
// no d10 blink , no sda , no scl , no display
 
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /*clock=*/ SCL_PIN, /* data=*/ SDA_PIN, /* reset=*/ U8X8_PIN_NONE);
// no d10 blink , no sda , no scl , no display
 
//U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL_PIN, /* data=*/ SDA_PIN, /* reset=*/ U8X8_PIN_NONE);   // ESP32 Thing, pure SW emulated I2C
// ja d10 blinkt , ja sda , ja scl , display " Hello World " okay , refresh 500ms
 
void setup() {
u8g2.setBusClock(200000);
 // Wire.begin(SDA_PIN, SCL_PIN);
  u8g2.begin();  
 
//pinMode(D4, OUTPUT);//sda
//pinMode(D5, OUTPUT);//scl
pinMode(D10, OUTPUT);//LED for work test
}//end setup
 
void loop() {
digitalWrite(D10, LOW);  
//  delay(100);
  u8g2.clearBuffer();          // clear the internal memory
  u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
  u8g2.drawStr(0,10,"Hello 3. World!");  // write something to the internal memory
  u8g2.sendBuffer();          // transfer internal memory to the display
digitalWrite(D10, HIGH);  
  delay(1000);   
}//end loop

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎