Hallo zusammen,
ich benötigen unterstützung beim verwenden der U8g2lib mit meiner LCD Anzeige
Der Fehler liegt darin, dass die angezeigte Zeit am Rechten Rand wiederholt wird. Klingt für mich so als würde der Chip nicht die vollen 240 Pixel in der Länge auf 192 begrenzen und dann das Bild wiederholen, jedoch ist im Code eine Größe von 240X64 definiert, so wie es auch im Datenblatt angegeben ist.
Ich verstehe nicht warum sich das ganze am rechten Rand wiederholt. Könnte es trotzdem an der Initialisierung des LCD`s liegen? Außerdem hab ich bemerkt das nur wenige fonts überhaupt sauber angezeigt werden können. Die folgende hat am besten funktioniert.
U8g2lib Version: 2.32.15
Verwndet wird ein Arduino Mega 2560
LCD Anezige: EA W240-6K2HLW (siehe Datenblatt)
Anegzeigtes Bild:
Link zum Display: https://www.tme.eu/Document/90cd13b87c9830c77fe724251ebc81cb/EAW240-6K2HLW.pdf
verwndeter Code:
// Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
#include <Arduino.h>
#include <U8g2lib.h>
/*
U8g2lib Example Overview:
Frame Buffer Examples: clearBuffer/sendBuffer. Fast, but may not work with all Arduino boards because of RAM consumption
Page Buffer Examples: firstPage/nextPage. Less RAM usage, should work with all Arduino boards.
U8x8 Text Only Example: No RAM usage, direct communication with display controller. No graphics, 8x8 Text only.
This is a page buffer example.
*/
// Please UNCOMMENT one of the contructor lines below
// U8g2 Contructor List (Picture Loop Page Buffer)
// The complete list is available here: https://github.com/olikraus/u8g2/wiki/u8g2setupcpp
// Please update the pin numbers according to your setup. Use U8X8_PIN_NONE if the reset pin is not connected
//U8G2_NULL u8g2(U8G2_R0); // null device, a 8x8 pixel display which does nothing
U8G2_T6963_240X64_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable/wr=*/ 17, /*cs/ce=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND
//U8G2_T6963_256X64_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable/wr=*/ 17, /*cs/ce=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND
//U8G2_T6963_160X80_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable/wr=*/ 17, /*cs/ce=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND
//U8G2_T6963_128X64_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable/wr=*/ 17, /*cs/ce=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND
//U8G2_T6963_128X64_ALT_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable/wr=*/ 17, /*cs/ce=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND
void setup(void) {
/* U8g2 Project: T6963 Test Board */
pinMode(18, OUTPUT);
digitalWrite(18, 1);
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(90, 63, "9");
//u8g2.drawStr(125, 63, ":");
//u8g2.drawStr(145, 63, m_str);
/* Durch die VERschiebung des Cursers zeigt es die Zeit "Richtig" an */
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;
}
