cattledog:
Is the display declared as a 16x2?
Can you show the code with the cursor management? There should be some .setCursor() statements before the .print() statements.
Can you show the display library # include and lcd instantiation. It should be something like this.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
I just stripped out all of the extraneous code, focusing only on the LCD and array:
//===============================================================================//
#include <SoftwareSerial.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <EEPROM.h>
// "Un"comment the following line to see serial monitor message DEBUGGING output
//#define SERIAL_MONITOR_ON
// For storing TXT strings to Flash Memory
#define __PROG_TYPES_COMPAT__
#include <avr/pgmspace.h>
//================================================================================//
//================================================================================//
// define Global Variables //
//================================================================================//
//================================================================================//
//================================================================================//
// Define LCD MSG strings Load into String Array and Store in PERM memory
//================================================================================//
const char lcd_msg_0[] PROGMEM = "Begin line Zero ";
const char lcd_msg_1[] PROGMEM = " Welcome to the ";
const char lcd_msg_2[] PROGMEM = " Beta Test of ";
const char lcd_msg_3[] PROGMEM = " -------------- ";
const char lcd_msg_4[] PROGMEM = "text for line 4 ";
const char lcd_msg_5[] PROGMEM = "text for line 5 ";
const char lcd_msg_6[] PROGMEM = "text for line 6 ";
const char lcd_msg_7[] PROGMEM = "text for line 7 ";
const char lcd_msg_8[] PROGMEM = "text for line 8 ";
const char lcd_msg_9[] PROGMEM = "It goes on & on ";
// Fill up lcd_msg table with lcd_msg TXT defined above
PGM_P const lcd_msg_table[] PROGMEM =
{
lcd_msg_0, lcd_msg_1, lcd_msg_2, lcd_msg_3, lcd_msg_4, lcd_msg_5, lcd_msg_6, lcd_msg_7, lcd_msg_8, lcd_msg_9,
};
// LCD Max String size is 16 characters
char lcd_line1[16];
char lcd_line2[16];
//================================================================================//
// Initialize functions //
//================================================================================//
void EEPROM_Read(float *num, int MemPos);
void EEPROM_Write(float *num, int MemPos);
void LCD_Msg(LiquidCrystal_I2C &lcd, int top, int bottom, unsigned long del);
void Msg(LiquidCrystal_I2C &lcd, const char *top, const char *bottom, unsigned long del);
//================================================================================//
// Assign Arduino pins to each LED lights GPS and Pizo //
//================================================================================//
LiquidCrystal_I2C lcd(0x27, 16, 2);
// Uhoh.. Should I add something here to define more related to the 16x2 ????
//================================================================================//
// Setup and Initialization //
//================================================================================//
void setup()
{
// establish communication with 16x2 LCD //
lcd.init();
lcd.begin (16, 2);
lcd.backlight();
} // END Setup()
//================================================================================//
// END Setup and Initialization //
//================================================================================//
//================================================================================//
// BEGIN MAIN LOOP //
//================================================================================//
void loop(void)
{
// "Begin line Zero " , "It goes on & on ", delay 1500 SHOULD display " Begin line Zero on first line
// and "It goes on & on" on second line. This only displays the second line.
LCD_Msg(lcd, 0, 9, 1500);
}
//================================================================================//
// END MAIN LOOP //
//================================================================================//
//================================================================================//
// Start Script - Opening Greeting //
//================================================================================//
void Start_Script_Intro(void)
{
// "Welcome to the " , " Beta Test of "
LCD_Msg(lcd, 1, 2, 2500);
//"------------ ", "text for line 4 "
LCD_Msg(lcd, 3, 4, 2500);
// "text for line 5 ", "text for line 6 "
LCD_Msg(lcd, 5, 6, 2500);
// Etc...
} // END Start_Script_Demo()
//================================================================================//
//================================================================================//
void EEPROM_Write(float *num, int MemPos)
{
byte ByteArray[4];
memcpy(ByteArray, num, 4);
for (int x = 0; x < 4; x++)
{
EEPROM.write((MemPos * 4) + x, ByteArray[x]);
}
}
//================================================================================//
//================================================================================//
void EEPROM_Read(float *num, int MemPos)
{
byte ByteArray[4];
for (int x = 0; x < 4; x++)
{
ByteArray[x] = EEPROM.read((MemPos * 4) + x);
}
memcpy(num, ByteArray, 4);
}
//================================================================================//
//================================================================================//
// Grab messages from Stored Array and display for a specified duration //
//================================================================================//
void LCD_Msg(LiquidCrystal_I2C & lcd, int top, int bottom, unsigned long del)
{
strcpy_P(lcd_line1, (char*)pgm_read_word(&(lcd_msg_table[top])));
strcpy_P(lcd_line2, (char*)pgm_read_word(&(lcd_msg_table[bottom])));
lcd.clear();
lcd.setCursor(0,0);
lcd.print(lcd_line1); // if changed to (top) LCD displays message #, not text
lcd.setCursor(0,1);
lcd.print(lcd_line2);
delay(del);
}
//================================================================================//
//================================================================================//
// Display message. Used for Debug. Otherwise replaced w/ LCD_Msg f()
//================================================================================//
void Msg(LiquidCrystal_I2C & lcd, const char * top, const char * bottom, unsigned long del)
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(top);
lcd.setCursor(0, 1);
lcd.print(bottom);
delay(del);
}
//================================================================================//
//================================================================================//
// END SKETCH //
//================================================================================//