Hi,
I have made a data logger for fuel consumption and fuel flow and I have it logged to SD card with RTC time stamp and also the results are sent via serial connection to PC. Now I am trying to add a KS0108 128x64 display, so I don't have to have a PC connected to see data in real time. I have problems getting the vaules printed to the screen when I program in the data logger sketch, but I can print to it fine in a fresh clean sketch like this:
// include the library header
#include <glcd.h>
// include the Fonts
#include <fonts/allFonts.h>
void setup() {
// put your setup code here, to run once:
// Initialize the GLCD
GLCD.Init();
// Select the font for the default text area
GLCD.SelectFont(System5x7);
GLCD.SetFontColor( WHITE);
GLCD.SetTextMode(SCROLL_UP);
GLCD.SetDisplayMode(NON_INVERTED);
//text areas
/* gText S1 = gText(0, 0, 17, 6); //supply 1 area
gText R1 = gText(0, 8, 17, 15) ; //return 1 area
gText BR1 = gText(0, 16, 17, 27); //BurnRate1 area
gText TB1 = gText(0, 23, 17, 31); //Total Burn area
gText S2 = gText(0, 32, 17, 39); //supply 2 area
gText R2 = gText(0, 40, 17, 47); //return 2 area 2
gText BR2 = gText(0, 48, 17, 55); //BurnRate1 area 2
gText TB2 = gText(0, 56, 17, 63); //Total Burn area 2
gText valS1 = gText(18, 0, 49, 6);
gText valR1 = gText(18, 8, 49, 15);
gText valBR1 = gText(18, 16, 49, 23);
gText valTV1 = gText(18, 23, 49, 31);
gText valS2 = gText(18, 32, 49, 39);
gText valR2 = gText(18, 40, 49, 47);
gText valBR2 = gText(18, 56, 49, 55);
gText valTV2 = gText(18, 63, 49, 63);
*/
// Print definitions
GLCD.println("S1:");
GLCD.println("R1:");
}
void loop() {
// put your main code here, to run repeatedly:
GLCD.ClearArea();
GLCD.println("Hello");
GLCD.println("This works.");
delay(1000);
As you can see I tried creating text fields, but I haven't gotten that working yet. The data logger sketch compiles fine, but only prints gibberish to the GLCD... I thought it might be an issue with pin addressing, but I haven't found any conflicts (yet)...
Attached is the sketch for the datalogger.
Fuel_Flow_Logging_to_SD_Card_4_channels_2_GLCD.ino (11.3 KB)