Writing GPS Shield Data to HTI2CLCD 2004 via HT Backpack [SOLVED]

This was fixed by using dtostrf() function & converting the float variable to a string, as per:-

dtostrf(floatvar, minStringWidthIncDecimalPoint, numVarsAfterDecimal, charbuf);

In my case:-

lcd.setCursor(lcd_address,3,1);
lcd.print(lcd_address,"LAT=");
char ascii[15];
dtostrf(flat,7,3,ascii);
lcd.print(lcd_address, ascii);

Many thanks to Mike at Hobbytronics.

I wonder if someone might be able to help... (please excuse my lack of programming knowledge [old dog & new tricks])

I've tried to merge GPS Shield code (TinyGPS) with Hobbytronics LCD Backpack (probably quite poorly) and can't figure out how to write Lat & Lon GPS data to the LCD. I've tried various iterations of LCD.print & such like to no avail (lines 132 to 135 inc.). For example, I cannot write 'flat' to the screen, but the Hobbytronics & counter example works fine:-

lcd.setCursor(lcd_address,3,1);
** char ascii[32];**
** sprintf(flat);**
** lcd.print(lcd_address,ascii);**

Equipment:-
UNO R3
Sparkfun GPS Shield GPS-10710 with EM406 GPS
Hobbytronics LCD Backpack V2
LCD Display HM2004A VER1.0

Libraries:-
<SoftwareSerial.h>
<HTI2CLCD.h>
<Wire.h>
<TinyGPS.h>

Best regards,
Myles

PS
Please find a copy of my code (if only for fun)...

#include <SoftwareSerial.h>

#include <TinyGPS.h>


//LCD
#include <Wire.h>
#include <HTI2CLCD.h>        // Include the Library

HTI2CLCD lcd;                // Create an instance of the HTI2CLCD

const int  lcd_address=123;   // I2C Address of LCD backpack (Scanned using I2C Scanner, found to be 0x7B = 123)
unsigned long counter=0;
int bl=75; // Backlight power value
unsigned long my=49;
unsigned long currentTime;
unsigned long bloopTime;
unsigned long cloopTime;
byte updown=0;

// We can create up to 8 of our own characters to display
// Here we define 2 characters to be uploaded
byte ht_logo[8] = {
  B10100,
  B10100,
  B11111,
  B10110,
  B10110,
  B00010,
  B00010,
};
byte smiley[8] = {
  B00000,
  B10001,
  B00100,
  B00100,
  B10001,
  B01110,
  B00000,
};

/*
  I2CLCD
  Example Arduino sketch to communicate with HobbyTronics I2CLCD backpack
  The I2CLCD backpack turns a standard HD44780 LCD display into an I2C addressable device
  which will free up many pins for use elsewhere. 
  
  Requires the Hobbytronics HTI2CLCD library
  
  Copyright (c) 2011 www.hobbytronics.co.uk 
 
  This example code is in the public domain.
*/

//GPS
/* This sample code demonstrates the normal use of a TinyGPS object.
   It requires the use of SoftwareSerial, and assumes that you have a
   4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
*/

TinyGPS gps;
SoftwareSerial ss(2, 3);

void setup() {
   Serial.begin(115200);
  ss.begin(4800);
  
  Serial.print("Simple TinyGPS library v. "); Serial.println(TinyGPS::library_version());
  Serial.println("by Mikal Hart");
  Serial.println();
  
  
  
  // LCD:
  
  
  
  delay(200);                              // Give LCD time to configure itself  
    Wire.begin();                            // join i2c bus (address optional for master)
    lcd.setType(lcd_address,4,20);           // Define rows and columns for LCD 
    
    lcd.createChar(lcd_address,0, ht_logo);  // Upload ht_logo as character 0
    lcd.createChar(lcd_address,1, smiley);   // Upload smiley as character 1
    
    lcd.clear(lcd_address);                  // Clear LCD
    lcd.backLight(lcd_address,10);           // Set backlight to dim
    
    // Display String
    lcd.write(lcd_address,0);                // Display our ht_logo character
    lcd.print(lcd_address," HobbyTronics ");
    lcd.write(lcd_address,1);                // Display our smiley character
         
    currentTime = millis();
    cloopTime = currentTime; 
    bloopTime = currentTime;  

}

void loop() {
  // firstly GPS...
  {
  bool newData = false;
  unsigned long chars;
  unsigned short sentences, failed;

  // For one second we parse GPS data and report some key values
  for (unsigned long start = millis(); millis() - start < 1000;)
  {
    while (ss.available())
    {
      char c = ss.read();
      // Serial.write(c); // uncomment this line if you want to see the GPS data flowing
      if (gps.encode(c)) // Did a new valid sentence come in?
        newData = true;
    }
  }

  if (newData)
  {
    float flat, flon;
    unsigned long age;
    gps.f_get_position(&flat, &flon, &age);
    Serial.print("LAT=");
    Serial.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
    Serial.print(" LON=");
    Serial.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);
    Serial.print(" SAT=");
    Serial.print(gps.satellites() == TinyGPS::GPS_INVALID_SATELLITES ? 0 : gps.satellites());
    Serial.print(" PREC=");
    Serial.print(gps.hdop() == TinyGPS::GPS_INVALID_HDOP ? 0 : gps.hdop());

      lcd.setCursor(lcd_address,3,1);
      char ascii[32];
      sprintf(flat);
      lcd.print(lcd_address,ascii);

  }
  
  {
  
  gps.stats(&chars, &sentences, &failed);
  Serial.print(" CHARS=");
  Serial.print(chars);
  Serial.print(" SENTENCES=");
  Serial.print(sentences);
  Serial.print(" CSUM ERR=");
  Serial.println(failed);
  if (chars == 0)
    Serial.println("** No characters received from GPS: check wiring **");

//now LCD...

{
    currentTime = millis();
    
  
    
    if(currentTime >= (cloopTime + 30)){  
      // Create String with Text and Number
      lcd.setCursor(lcd_address,2,1);
      char ascii[32];
      sprintf(ascii,"Counter: %0.7d",counter);
      lcd.print(lcd_address,ascii);
      counter++;    
      cloopTime = currentTime;  // Updates cloopTime
    }

    if(currentTime >= (bloopTime + 20)){ 
      // Lets increase the brightness until we hit 150, then we reduce back to 0 again
      if(updown==75) bl++;
      else bl--;
      if(bl==150) updown=1;
      if(bl==45) updown=75;
      lcd.backLight(lcd_address,bl);
      
      bloopTime = currentTime;  // Updates bloopTime
    }
}

  }
  }
}