Hello wonderful people!
I'm trying to reuse my Creality Ender 3's old screen and encoder for a project in which I need fast display code. It seems to me that U8x8 is the better option.
Now, I can't get U8x8 to work properly. I've tried both HelloWorld examples and while the u8g2 one comes clean, the u8x8 one seems rotated and full of noise.
Has anyone else experienced this?
I'm using a Pro Micro, and I've compiled and uploaded both sketches back-to-back, without changing any wiring.
Code and result for u8g2:
#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,/* CS=*/ 10, /* reset=*/ 8);
void setup(void) {
u8g2.begin();
}
void loop(void) {
u8g2.firstPage();
do {
u8g2.setFont(u8g2_font_ncenB10_tr);
u8g2.drawStr(0,24,"Hello World!");
} while ( u8g2.nextPage() );
delay(1000);
}
Code and result with u8x8:
#include <Arduino.h>
#include <U8x8lib.h>
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
U8X8_ST7920_128X64_HW_SPI u8x8(/* CS=*/ 10, /* reset=*/ 8);
void setup(void)
{
u8x8.begin();
}
void loop(void)
{
u8x8.setFont(u8x8_font_5x8_f);
u8x8.drawString(0,1,"Hello World!");
u8x8.setInverseFont(1);
u8x8.drawString(0,0,"012345678901234567890123456789");
u8x8.setInverseFont(0);
delay(1000);
}
Thank you all very much.