Page 1 of 1

Not displaying correctly on LCD_R61581

Posted: Tue May 17, 2016 2:23 am
by Menox
I just got Kit #3 and set it up and compiled the code. The values from the GPS and the OBD-II adapter are displaying. What is not displaying correctly is the initialization screen (Text gets cut off at one the first character) and the main screen that displays the data (characters also get cut off at one character for km/h etc and ENGINE/DISTANCE/LOAD, etc doesn't get displayed at all:

lcd.setColor(RGB16_CYAN);
lcd.setFontSize(FONT_SIZE_SMALL);
lcd.setCursor(110, 4);
lcd.print("km/h");
lcd.setCursor(110, 8);
lcd.print("RPM");
lcd.setCursor(110, 11);
lcd.print("ENGINE");
lcd.setCursor(110, 12);
lcd.print("LOAD %");

//lcd.setFont(FONT_SIZE_MEDIUM);
lcd.setColor(RGB16_CYAN);
lcd.setCursor(184, 2);
lcd.print("ELAPSED:");
lcd.setCursor(184, 5);
lcd.print("DISTANCE: km");
lcd.setCursor(184, 8);
lcd.print("AVG SPEED: kph");
lcd.setCursor(184, 11);
lcd.print("ALTITUDE: m");

lcd.setCursor(18, 18);
lcd.print("BATTERY: V");
lcd.setCursor(18, 21);
lcd.print("THROTTLE: %");
lcd.setCursor(18, 24);
lcd.print("FUEL RATE: L/h");
lcd.setCursor(18, 27);
lcd.print("INTAKE: C");

lcd.setCursor(184, 18);
lcd.print("UTC:");
lcd.setCursor(184, 19);
lcd.print("LAT:");
lcd.setCursor(280, 19);
lcd.print("SAT:");
lcd.setCursor(184, 20);
lcd.print("LNG:");

lcd.setFontSize(FONT_SIZE_SMALL);
lcd.setCursor(184, 22);
lcd.print("ACC:");
lcd.setCursor(184, 23);
lcd.print("GYR:");
lcd.setCursor(184, 24);
lcd.print("MAG:");

lcd.setCursor(184, 26);
lcd.print("OBD FREQ:");

lcd.setCursor(184, 27);
lcd.print("GPS FREQ:");

lcd.setCursor(184, 28);
lcd.print("LOG SIZE:");

The only text that is displayed in this code is the first character of the 'k' for km, 'k' for kph, etc for all of the text displayed.
What is causing this and how can I fix it?

*EDIT
I'm using Bluno MEGA 2560 (ATmega2560+BLE) and the 3.5" LCD_R61581 LCD screen.

Re: Not displaying correctly on LCD_R61581

Posted: Tue May 17, 2016 7:56 pm
by stanley
Does the megalogger sketch work for you?

Re: Not displaying correctly on LCD_R61581

Posted: Wed May 18, 2016 5:52 am
by Menox
Yes, I actually am close to getting this display working correctly. I have changed R61581.cpp here and it's not cutting the words off at the first character:

size_t LCD_R61581::write(uint8_t c)
{
/* if (c == '\n') {
m_y += (m_font + 1) << 3;
return 0;
} else if (c == '\r') {
m_x = 0;
return 0;
} */
if (c == '\n') {
m_x += (m_font + 1) << 3;
return 0;
} else if (c == '\r') {
setXY(m_x, m_x + 7, m_y, disp_y_size - 1);
clearPixels((disp_y_size - m_y) * 8);
m_y = 0;
return 0;
}

EDIT: Here's the working code for this screen:
size_t LCD_R61581::write(uint8_t c)
{
if (c == '\n') {
m_x += (m_font + 1) << 3;
return 0;
} else if (c == '\r') {
setXY(m_x, m_x + 7, m_y, disp_y_size - 1);
m_x = 0;
m_y += (m_font + 1) << 3;
return 0;
}
if (m_x > disp_y_size) return 0;
Enable();
....

Re: Not displaying correctly on LCD_R61581

Posted: Sun Jun 05, 2016 10:59 am
by stanley
Did you use Arduino IDE from arduino.org as is described in the developer's guide?

Re: Not displaying correctly on LCD_R61581

Posted: Thu Jun 09, 2016 9:48 pm
by X4CODE
i also had this problem with my kit3 and 3.5 Screen.

I tried Menox fix and it works good!!! Thanks a lot :)