Display BME280 information on to ILI9225 TFT screen

I'm new to this.
I have been trying to get the information I get from the BME280 which is displayed on the serial printer screen, Temp and Humidity to be displayed on this ILI9225 TFT screen. I have tried the tft.print option and I the following error.
'class TFT_22_ILI9225' has no member named 'print'
I have been searching the internet and I have not found anything of use for me.
The little information I could find on the ILI9225 TFT screen I could use to get the screen to work. I'm now trying to take the information I get from the BME device to show and update on the TFT screen.

Regards

Most libraries have example code bundled with them. Take a look at those. What function is used to make text appear on the screen?

If You provide the code it would surely help helpers.

This is what I have managed to get so far.

I managed to get the BME280 to provide me data on a serial screen. and added the TFT code to. I can get the strings to print on the screen. What I want to achieve is have the info from the serial.print to be shown in the string info on the screen.

Code below
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include <TFT_22_ILI9225.h>

#include <../fonts/FreeSans9pt7b.h>
#include <../fonts/FreeSans12pt7b.h>
#include <../fonts/FreeSerif9pt7b.h>

#define BME_SCK 13
#define BME_MISO 12
#define BME_MOSI 11
#define BME_CS 10

#if defined (ARDUINO_ARCH_STM32F1)
#define TFT_RST PA1
#define TFT_RS PA2
#define TFT_CS PA0 // SS
#define TFT_SDI PA7 // MOSI
#define TFT_CLK PA5 // SCK
#define TFT_LED 0 // 0 if wired to +5V directly
#elif defined(ESP8266)
#define TFT_RST 4 // D2
#define TFT_RS 5 // D1
#define TFT_CLK 14 // D5 SCK
//#define TFT_SDO 12 // D6 MISO
#define TFT_SDI 13 // D7 MOSI
#define TFT_CS 15 // D8 SS
#define TFT_LED 2 // D4 set 0 if wired to +5V directly -> D3=0 is not possible !!
#elif defined(ESP32)
#define TFT_RST 26 // IO 26
#define TFT_RS 25 // IO 25
#define TFT_CLK 14 // HSPI-SCK
//#define TFT_SDO 12 // HSPI-MISO
#define TFT_SDI 13 // HSPI-MOSI
#define TFT_CS 15 // HSPI-SS0
#define TFT_LED 0 // 0 if wired to +5V directly
SPIClass hspi(HSPI);
#else
#define TFT_RST 8
#define TFT_RS 9
#define TFT_CS 10 // SS
#define TFT_SDI 11 // MOSI
#define TFT_CLK 13 // SCK
#define TFT_LED 3 // 0 if wired to +5V directly
#endif
#define TFT_BRIGHTNESS 200 // Initial brightness of TFT backlight (optional)

Adafruit_BME280 bme; // I2C
//Adafruit_BME280 bme(BME_CS); // hardware SPI
//Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK); // software SPI

int BMEwaitT=1000;
int delayTime=BMEwaitT;

// Use hardware SPI (faster - on Uno: 13-SCK, 12-MISO, 11-MOSI)
TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_LED, TFT_BRIGHTNESS);
// Use software SPI (slower)
//TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_SDI, TFT_CLK, TFT_LED, TFT_BRIGHTNESS);

// Variables and constants
int16_t x=0, y=0, w, h;
int orientation ();

void setup() {
Serial.begin(115200);
Serial.println(F("BME280 Startup"));

if (! bme.begin(0x76, &Wire)) {
    Serial.println("Could not find a valid BME280 sensor, check wiring!");
    while (1);
}

Serial.println("-- Default Test --");
Serial.println("normal mode, 16x oversampling for all, filter off,");
Serial.println("0.5ms standby period");
delayTime = BMEwaitT;


Serial.println();

#if defined(ESP32)

hspi.begin();
tft.begin(hspi);
#else
tft.begin();
#endif
tft.clear();
tft.setOrientation (3);

String s1 = "Temperature";
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s1, x, y, &w, &h); // Get string extents
y = h; // Set y position to string height
tft.drawGFXText(x, y, s1, COLOR_BLUE); // Print string

String s2 = "Humidity 48 %";
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s2, x, y, &w, &h); // Get string extents
y += h + 6; // Set y position to string height
tft.drawGFXText(x, y, s2, COLOR_BLUE); // Print string

String s3 = "Air Pressure Hpa";
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s3, x, y, &w, &h); // Get string extents
y += h + 6; // Set y position to string height
tft.drawGFXText(x, y, s3, COLOR_BLUE); // Print string

String s4 = "Air Pressure inHg";
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s4, x, y, &w, &h); // Get string extents
y += h + 6; // Set y position to string height
tft.drawGFXText(x, y, s4, COLOR_BLUE); // Print string

String s5 = "Air Pressure mmHg"; // Create string object
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s5, x, y, &w, &h); // Get string extents
y += h + 6; // Set y position to string height plus shift down 10 pixels
tft.drawGFXText(x, y, s5, COLOR_BLUE); // Print string

String s6 = "Altitude 1408m"; // Create string object
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s6, x, y, &w, &h); // Get string extents
y += h + 6; // Set y position to string height plus shift down 10 pixels
tft.drawGFXText(x, y, s6, COLOR_BLUE); // Print string

String s7 = "LAT -25.731340"; // Create string object
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s7, x, y, &w, &h); // Get string extents
y += h + 6; // Set y position to string height plus shift down 10 pixels
tft.drawGFXText(x, y, s7, COLOR_BLUE); // Print string

String s8 = "LON 28.218370"; // Create string object
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s8, x, y, &w, &h); // Get string extents
y += h + 6; // Set y position to string height plus shift down 10 pixels
tft.drawGFXText(x, y, s8, COLOR_BLUE); // Print string
}

void loop() {
// Only needed in forced mode! In normal mode, you can remove the next line.
bme.takeForcedMeasurement(); // has no effect in normal mode

printValues();
delay(delayTime);

}

void printValues() {
Serial.print("Temperature = ");
Serial.print(bme.readTemperature());
Serial.println(" °C");

Serial.print("Pressure = ");
Serial.print(bme.readPressure() / 100.0F);
Serial.println(" hPa");

Serial.print("Pressure = ");
Serial.print((bme.readPressure() / 100.0F)*0.03);
Serial.println(" inHg");

Serial.print("Pressure = ");
Serial.print((bme.readPressure() / 100.0F)*0.75006157584566);
Serial.println(" mmHg");

Serial.print("Humidity = ");
Serial.print(bme.readHumidity());
Serial.println(" %");

Serial.println();

}

Thanks, but You forgot using autoformat in the IDE and code tags, </>, when posting.
For the moment only a cell phone is available.....

<#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include <TFT_22_ILI9225.h>

#include <../fonts/FreeSans9pt7b.h>
#include <../fonts/FreeSans12pt7b.h>
#include <../fonts/FreeSerif9pt7b.h>

#define BME_SCK 13
#define BME_MISO 12
#define BME_MOSI 11
#define BME_CS 10

#if defined (ARDUINO_ARCH_STM32F1)
#define TFT_RST PA1
#define TFT_RS PA2
#define TFT_CS PA0 // SS
#define TFT_SDI PA7 // MOSI
#define TFT_CLK PA5 // SCK
#define TFT_LED 0 // 0 if wired to +5V directly
#elif defined(ESP8266)
#define TFT_RST 4 // D2
#define TFT_RS 5 // D1
#define TFT_CLK 14 // D5 SCK
//#define TFT_SDO 12 // D6 MISO
#define TFT_SDI 13 // D7 MOSI
#define TFT_CS 15 // D8 SS
#define TFT_LED 2 // D4 set 0 if wired to +5V directly -> D3=0 is not possible !!
#elif defined(ESP32)
#define TFT_RST 26 // IO 26
#define TFT_RS 25 // IO 25
#define TFT_CLK 14 // HSPI-SCK
//#define TFT_SDO 12 // HSPI-MISO
#define TFT_SDI 13 // HSPI-MOSI
#define TFT_CS 15 // HSPI-SS0
#define TFT_LED 0 // 0 if wired to +5V directly
SPIClass hspi(HSPI);
#else
#define TFT_RST 8
#define TFT_RS 9
#define TFT_CS 10 // SS
#define TFT_SDI 11 // MOSI
#define TFT_CLK 13 // SCK
#define TFT_LED 3 // 0 if wired to +5V directly
#endif
#define TFT_BRIGHTNESS 200 // Initial brightness of TFT backlight (optional)

Adafruit_BME280 bme; // I2C
//Adafruit_BME280 bme(BME_CS); // hardware SPI
//Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK); // software SPI

int BMEwaitT = 1000;
int delayTime = BMEwaitT;

// Use hardware SPI (faster - on Uno: 13-SCK, 12-MISO, 11-MOSI)
TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_LED, TFT_BRIGHTNESS);
// Use software SPI (slower)
//TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_SDI, TFT_CLK, TFT_LED, TFT_BRIGHTNESS);

// Variables and constants
int16_t x = 0, y = 0, w, h;
int orientation ();

void setup() {
Serial.begin(115200);
Serial.println(F("BME280 Startup"));

if (! bme.begin(0x76, &Wire)) {
Serial.println("Could not find a valid BME280 sensor, check wiring!");
while (1);
}

Serial.println("-- Default Test --");
Serial.println("normal mode, 16x oversampling for all, filter off,");
Serial.println("0.5ms standby period");
delayTime = BMEwaitT;

Serial.println();

#if defined(ESP32)
hspi.begin();
tft.begin(hspi);
#else
tft.begin();
#endif
tft.clear();
tft.setOrientation (3);

String s1 = "Temperature";
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s1, x, y, &w, &h); // Get string extents
y = h; // Set y position to string height
tft.drawGFXText(x, y, s1, COLOR_BLUE); // Print string

String s2 = "Humidity 48 %";
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s2, x, y, &w, &h); // Get string extents
y += h + 6; // Set y position to string height
tft.drawGFXText(x, y, s2, COLOR_BLUE); // Print string

String s3 = "Air Pressure Hpa";
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s3, x, y, &w, &h); // Get string extents
y += h + 6; // Set y position to string height
tft.drawGFXText(x, y, s3, COLOR_BLUE); // Print string

String s4 = "Air Pressure inHg";
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s4, x, y, &w, &h); // Get string extents
y += h + 6; // Set y position to string height
tft.drawGFXText(x, y, s4, COLOR_BLUE); // Print string

String s5 = "Air Pressure mmHg"; // Create string object
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s5, x, y, &w, &h); // Get string extents
y += h + 6; // Set y position to string height plus shift down 10 pixels
tft.drawGFXText(x, y, s5, COLOR_BLUE); // Print string

String s6 = "Altitude 1408m"; // Create string object
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s6, x, y, &w, &h); // Get string extents
y += h + 6; // Set y position to string height plus shift down 10 pixels
tft.drawGFXText(x, y, s6, COLOR_BLUE); // Print string

String s7 = "LAT -25.731340"; // Create string object
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s7, x, y, &w, &h); // Get string extents
y += h + 6; // Set y position to string height plus shift down 10 pixels
tft.drawGFXText(x, y, s7, COLOR_BLUE); // Print string

String s8 = "LON 28.218370"; // Create string object
tft.setGFXFont(&FreeSerif9pt7b); // Set current font
tft.getGFXTextExtent(s8, x, y, &w, &h); // Get string extents
y += h + 6; // Set y position to string height plus shift down 10 pixels
tft.drawGFXText(x, y, s8, COLOR_BLUE); // Print string
}

void loop() {
// Only needed in forced mode! In normal mode, you can remove the next line.
bme.takeForcedMeasurement(); // has no effect in normal mode

printValues();
delay(delayTime);
}

void printValues() {
Serial.print("Temperature = ");
Serial.print(bme.readTemperature());
Serial.println(" °C");

Serial.print("Pressure = ");
Serial.print(bme.readPressure() / 100.0F);
Serial.println(" hPa");

Serial.print("Pressure = ");
Serial.print((bme.readPressure() / 100.0F) * 0.03);
Serial.println(" inHg");

Serial.print("Pressure = ");
Serial.print((bme.readPressure() / 100.0F) * 0.75006157584566);
Serial.println(" mmHg");

Serial.print("Humidity = ");
Serial.print(bme.readHumidity());
Serial.println(" %");

Serial.println();
}>

Thanks, but You forgot using autoformat in the IDE and code tags, </>, when posting.

That is text, not code. The indentation created by autoformat and the code tags, </>, makes it much more readable.

Hi. I hope I got it correct now.

#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include <TFT_22_ILI9225.h>

#include <../fonts/FreeSans9pt7b.h>
#include <../fonts/FreeSans12pt7b.h>
#include <../fonts/FreeSerif9pt7b.h>

#define BME_SCK 13
#define BME_MISO 12
#define BME_MOSI 11
#define BME_CS 10

#if defined (ARDUINO_ARCH_STM32F1)
#define TFT_RST PA1
#define TFT_RS  PA2
#define TFT_CS  PA0 // SS
#define TFT_SDI PA7 // MOSI
#define TFT_CLK PA5 // SCK
#define TFT_LED 0 // 0 if wired to +5V directly
#elif defined(ESP8266)
#define TFT_RST 4   // D2
#define TFT_RS  5   // D1
#define TFT_CLK 14  // D5 SCK
//#define TFT_SDO 12  // D6 MISO
#define TFT_SDI 13  // D7 MOSI
#define TFT_CS  15  // D8 SS
#define TFT_LED 2   // D4     set 0 if wired to +5V directly -> D3=0 is not possible !!
#elif defined(ESP32)
#define TFT_RST 26  // IO 26
#define TFT_RS  25  // IO 25
#define TFT_CLK 14  // HSPI-SCK
//#define TFT_SDO 12  // HSPI-MISO
#define TFT_SDI 13  // HSPI-MOSI
#define TFT_CS  15  // HSPI-SS0
#define TFT_LED 0   // 0 if wired to +5V directly
SPIClass hspi(HSPI);
#else
#define TFT_RST 8
#define TFT_RS  9
#define TFT_CS  10  // SS
#define TFT_SDI 11  // MOSI
#define TFT_CLK 13  // SCK
#define TFT_LED 3   // 0 if wired to +5V directly
#endif
#define TFT_BRIGHTNESS 200 // Initial brightness of TFT backlight (optional)

Adafruit_BME280 bme; // I2C
//Adafruit_BME280 bme(BME_CS); // hardware SPI
//Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK); // software SPI

int BMEwaitT = 1000;
int delayTime = BMEwaitT;

// Use hardware SPI (faster - on Uno: 13-SCK, 12-MISO, 11-MOSI)
TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_LED, TFT_BRIGHTNESS);
// Use software SPI (slower)
//TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_SDI, TFT_CLK, TFT_LED, TFT_BRIGHTNESS);

// Variables and constants
int16_t x = 0, y = 0, w, h;
int orientation ();

void setup() {
  Serial.begin(115200);
  Serial.println(F("BME280 Startup"));

  if (! bme.begin(0x76, &Wire)) {
    Serial.println("Could not find a valid BME280 sensor, check wiring!");
    while (1);
  }

  Serial.println("-- Default Test --");
  Serial.println("normal mode, 16x oversampling for all, filter off,");
  Serial.println("0.5ms standby period");
  delayTime = BMEwaitT;


  Serial.println();

#if defined(ESP32)
  hspi.begin();
  tft.begin(hspi);
#else
  tft.begin();
#endif
  tft.clear();
  tft.setOrientation (3);

  String s1 = "Temperature";
  tft.setGFXFont(&FreeSerif9pt7b); // Set current font
  tft.getGFXTextExtent(s1, x, y, &w, &h); // Get string extents
  y = h; // Set y position to string height
  tft.drawGFXText(x, y, s1, COLOR_BLUE); // Print string

  String s2 = "Humidity 48 %";
  tft.setGFXFont(&FreeSerif9pt7b); // Set current font
  tft.getGFXTextExtent(s2, x, y, &w, &h); // Get string extents
  y += h + 6; // Set y position to string height
  tft.drawGFXText(x, y, s2, COLOR_BLUE); // Print string

  String s3 = "Air Pressure Hpa";
  tft.setGFXFont(&FreeSerif9pt7b); // Set current font
  tft.getGFXTextExtent(s3, x, y, &w, &h); // Get string extents
  y += h + 6; // Set y position to string height
  tft.drawGFXText(x, y, s3, COLOR_BLUE); // Print string

  String s4 = "Air Pressure inHg";
  tft.setGFXFont(&FreeSerif9pt7b); // Set current font
  tft.getGFXTextExtent(s4, x, y, &w, &h); // Get string extents
  y += h + 6; // Set y position to string height
  tft.drawGFXText(x, y, s4, COLOR_BLUE); // Print string

  String s5 = "Air Pressure mmHg"; // Create string object
  tft.setGFXFont(&FreeSerif9pt7b); // Set current font
  tft.getGFXTextExtent(s5, x, y, &w, &h); // Get string extents
  y += h + 6; // Set y position to string height plus shift down 10 pixels
  tft.drawGFXText(x, y, s5, COLOR_BLUE); // Print string

  String s6 = "Altitude 1408m"; // Create string object
  tft.setGFXFont(&FreeSerif9pt7b); // Set current font
  tft.getGFXTextExtent(s6, x, y, &w, &h); // Get string extents
  y += h + 6; // Set y position to string height plus shift down 10 pixels
  tft.drawGFXText(x, y, s6, COLOR_BLUE); // Print string

  String s7 = "LAT -25.731340"; // Create string object
  tft.setGFXFont(&FreeSerif9pt7b); // Set current font
  tft.getGFXTextExtent(s7, x, y, &w, &h); // Get string extents
  y += h + 6; // Set y position to string height plus shift down 10 pixels
  tft.drawGFXText(x, y, s7, COLOR_BLUE); // Print string

  String s8 = "LON 28.218370"; // Create string object
  tft.setGFXFont(&FreeSerif9pt7b); // Set current font
  tft.getGFXTextExtent(s8, x, y, &w, &h); // Get string extents
  y += h + 6; // Set y position to string height plus shift down 10 pixels
  tft.drawGFXText(x, y, s8, COLOR_BLUE); // Print string
}


void loop() {
  // Only needed in forced mode! In normal mode, you can remove the next line.
  bme.takeForcedMeasurement(); // has no effect in normal mode

  printValues();
  delay(delayTime);
}


void printValues() {
  Serial.print("Temperature = ");
  Serial.print(bme.readTemperature());
  Serial.println(" °C");

  Serial.print("Pressure = ");
  Serial.print(bme.readPressure() / 100.0F);
  Serial.println(" hPa");

  Serial.print("Pressure = ");
  Serial.print((bme.readPressure() / 100.0F) * 0.03);
  Serial.println(" inHg");

  Serial.print("Pressure = ");
  Serial.print((bme.readPressure() / 100.0F) * 0.75006157584566);
  Serial.println(" mmHg");

  Serial.print("Humidity = ");
  Serial.print(bme.readHumidity());
  Serial.println(" %");

  Serial.println();
}

I have managed to get the values displaying on the ILI9225 TFT screen.
Below the bit of the code I got to work.

  tft.setFont(Terminal11x16);
  tft.drawText(10, 5, "Temp C:", COLOR_BLUE);
  drawTempInColour(120, 5, tp, GetColourForTemp(tp));