Hello,
I am referring to this subject
How to connect LCD 12864 ST7920 to NodeMCU ESP8266 module?
tried this but it always blue screen and there is no "Hello World" or any other text that i wrote in the code.
Is it a problem with the code or something with a wire connection?
I connect everithing like in schema except VCC => 5V, because ESP8266 doesn't have 5v, only 3V.
this is my code:
#include <Arduino.h>
#include <U8g2lib.h>
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
//U8G2_ST7920_128X64_1_HW_SPI u8g2(U8G2_R0,D8);
U8G2_ST7920_128X64_1_SW_SPI u8g2(U8G2_R0, /* clock=/ 14, / data=/ 13, / CS=*/ 15);
void setup(void) {
u8g2.begin();
}
uint8_t m = 24;
void loop(void) {
char m_str[3];
strcpy(m_str, u8x8_u8toa(m, 2)); /* convert m to a string with two digits */
u8g2.firstPage();
do {
u8g2.setFont(u8g2_font_logisoso62_tn);
u8g2.drawStr(0,63,"9");
u8g2.drawStr(33,63,":");
u8g2.drawStr(50,63,m_str);
} while ( u8g2.nextPage() );
delay(1000);
m++;
if ( m == 60 )
m = 0;
}
I tried this as well:
void setup(void) {
u8g2.begin();
}
void loop(void) {
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
u8g2.drawStr(0,10,"Hello World!"); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
delay(1000);
}
Do I need to select some other display?