invalid conversion from 'int' to 'const char'

So I am still programming google glass but I am switching everything to arduino uno instead of using the esplora built in librarys.
And I get the normal "invalid conversion from 'int' to 'const char' "
Heres my code:

#define cs   10
#define dc   9
#define rst  8
#include <TFT.h>           
#include <SPI.h> 
TFT TFTscreen = TFT(cs, dc, rst);
int tempsensor = A0;
int lightsensor = A1;
const int buttonone = 2;
const int buttontwo = 3;
const int buttonthree = 5;
int buttonos = 0;
int buttonts = 0;
int buttontrs = 0;
int temp = 0;
int light = 0;
void setup() {
  pinMode(buttonone, INPUT);
  pinMode(buttontwo, INPUT);
  pinMode(buttonthree, INPUT);
  Serial.begin(9600);
  TFTscreen.begin();
  TFTscreen.background(0 , 129 , 255);
  TFTscreen.stroke(254 , 254 , 0);
  TFTscreen.setTextSize(2);
  TFTscreen.text("Hi I am \n ", 0, 0);
  TFTscreen.text("GLASS\n ", 0, 16);
  TFTscreen.setTextSize(1);
  TFTscreen.stroke(0 , 0 , 0);
  TFTscreen.text("Weather:\n ", 10, 65);
  light = analogRead(lightsensor);
  if (light > 1000) {
  TFTscreen.fill(254 , 254 , 0);
  TFTscreen.circle(TFTscreen.width()/5.5,TFTscreen.height()/1.5, 10);
  delay(500);
  }
  else { 
  TFTscreen.stroke(0 , 0 , 148);
  TFTscreen.line(37, 95, 37, 77);
  TFTscreen.line(20, 96, 20, 79);
  TFTscreen.line(10, 92, 10, 74);
  TFTscreen.line(25, 96, 25, 78);
  TFTscreen.line(32, 86, 32, 70);
  }
  temp = analogRead(tempsensor);
  TFTscreen.stroke(0 , 0 , 0);
  TFTscreen.setTextSize(1);
  TFTscreen.text("Tempature:\n ", 10, 40);
  TFTscreen.setTextSize(2);
  TFTscreen.text(temp, 10, 50);
}

void loop() {
  buttonos = digitalRead(buttonone);
  buttonts = digitalRead(buttontwo);
  buttontrs = digitalRead(buttonthree);
  TFTscreen.stroke(254 , 0 , 0);
  TFTscreen.line(84, 15, 84, 128);
  TFTscreen.setTextSize(1);
  delay(500);
  //VOICEEEEEEEE????????????///////?/////////////////////////////??????????????????????////////////
  TFTscreen.text("Ask me\n ", 95, 5);
  TFTscreen.text("anything\n ", 95, 12);
  if (buttonos == HIGH) {
    //HIGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH                  directions   
   TFTscreen.text("Directions\n", 90, 20); 
   TFTscreen.stroke(0 , 0 , 0);
   TFTscreen.line(95, 30, 95, 128);
   TFTscreen.text("Lake\n", 97, 50);
   TFTscreen.text("Shore\n", 97, 56);
   TFTscreen.line(95, 35, 160, 35);
   TFTscreen.text("Parkland\n", 100, 37);
   TFTscreen.line(95, 70, 150, 70);
   TFTscreen.text("Porcupine\n", 98, 74);
   TFTscreen.line(150, 70, 158, 35);
   TFTscreen.line(95, 90, 158, 90);
   TFTscreen.line(158, 90, 150, 70);
   TFTscreen.text("Bexhill\n", 97, 93);
   TFTscreen.line(95, 105, 160, 105);
   TFTscreen.text("Medowood\n", 97, 108);
   TFTscreen.stroke(0 , 254 , 0);
   TFTscreen.line(140, 91, 140, 105);
   TFTscreen.line(141, 91, 141, 105);
   TFTscreen.line(142, 91, 142, 105);
   TFTscreen.line(143, 91, 143, 105);
   TFTscreen.line(144, 91, 144, 105);
   TFTscreen.line(145, 91, 145, 105);
   TFTscreen.line(146, 91, 146, 105);
   TFTscreen.stroke(0 , 129 , 255);
   delay(5000);
   TFTscreen.text("Directions\n", 90, 20); 
   TFTscreen.stroke(0 , 129 , 255);
   TFTscreen.line(95, 30, 95, 128);
   TFTscreen.text("Lake\n", 97, 50);
   TFTscreen.text("Shore\n", 97, 56);
   TFTscreen.line(95, 35, 160, 35);
   TFTscreen.text("Parkland\n", 100, 37);
   TFTscreen.line(95, 70, 150, 70);
   TFTscreen.text("Porcupine\n", 98, 74);
   TFTscreen.line(150, 70, 158, 35);
   TFTscreen.line(95, 90, 158, 90);
   TFTscreen.line(158, 90, 150, 70);
   TFTscreen.text("Bexhill\n", 97, 93);
   TFTscreen.line(95, 105, 160, 105);
   TFTscreen.text("Medowood\n", 97, 108);
   TFTscreen.stroke(0 , 129 , 255);
   TFTscreen.line(140, 91, 140, 105);
   TFTscreen.line(141, 91, 141, 105);
   TFTscreen.line(142, 91, 142, 105);
   TFTscreen.line(143, 91, 143, 105);
   TFTscreen.line(144, 91, 144, 105);
   TFTscreen.line(145, 91, 145, 105);
   TFTscreen.line(146, 91, 146, 105);
   
  }
  if (buttonts == HIGH)//medddddddddddddddddddd
  {
    TFTscreen.fill(255 , 255 , 255);
    TFTscreen.stroke(0 , 255 , 0);
    TFTscreen.text("Shops\n", 97, 20);
    TFTscreen.stroke(0 , 0 , 0);
    TFTscreen.text("and\n", 128, 20);
    TFTscreen.stroke(0 , 0 , 255);
    TFTscreen.text("restaurant \n", 97, 28);
    TFTscreen.stroke(0 , 0 , 0);
    TFTscreen.line(120, 38, 120, 128);
    TFTscreen.line(90, 90, 160, 90);
    TFTscreen.stroke(0 , 255 , 0);
    TFTscreen.circle(140, 115, 8);
    TFTscreen.stroke(0 , 0 , 255);
    TFTscreen.circle(100, 60, 8);
    TFTscreen.stroke(0 , 255 , 0);
    TFTscreen.circle(95, 80, 8);
    delay(5000);
    TFTscreen.fill(0 , 129 , 255);
    TFTscreen.stroke(0 , 129 , 255);
    TFTscreen.text("Shops\n", 97, 20);
    TFTscreen.stroke(0 , 129 , 255);
    TFTscreen.text("and\n", 128, 20);
    TFTscreen.stroke(0 , 129 , 255);
    TFTscreen.text("restaurant \n", 97, 28);
    TFTscreen.stroke(0 , 129 , 255);
    TFTscreen.line(120, 38, 120, 128);
    TFTscreen.line(90, 90, 160, 90);
    TFTscreen.stroke(0 , 129 , 255);
    TFTscreen.circle(140, 115, 8);
    TFTscreen.stroke(0 , 129 , 255);
    TFTscreen.circle(100, 60, 8);
    TFTscreen.stroke(0 , 129 , 255);
    TFTscreen.circle(95, 80, 8);
  }
  if (buttontrs == HIGH) {
    TFTscreen.text("swimming:\n", 86, 30);
    TFTscreen.text("monday\n", 86, 37);
    TFTscreen.text("4:30-6:30\n", 86, 45);
    TFTscreen.text("tuesday\n", 86, 53);
    TFTscreen.text("6:00-7:30\n", 86, 61);
    TFTscreen.text("thursday\n", 86, 69);
    TFTscreen.text("4:30-6:30\n", 86, 77);
    TFTscreen.text("sunday\n", 86, 85);
    TFTscreen.text("11:00-1:00\n", 86, 93);
    delay(5000);
    TFTscreen.stroke(0 , 129 , 255);
    TFTscreen.text("swimming:\n", 86, 30);
    TFTscreen.text("monday\n", 86, 37);
    TFTscreen.text("4:30-6:30\n", 86, 45);
    TFTscreen.text("tuesday\n", 86, 53);
    TFTscreen.text("6:00-7:30\n", 86, 61);
    TFTscreen.text("thursday\n", 86, 69);
    TFTscreen.text("4:30-6:30\n", 86, 77);
    TFTscreen.text("sunday\n", 86, 85);
    TFTscreen.text("11:00-1:00\n", 86, 93);
    }  
  }

Thank you!

At which line?

And I get the normal "invalid conversion from 'int' to 'const char' "

There's nothing "normal" about it- that's why it is called an error message.

I don't have the libraries, but I'm guessing it is complaining about this

temp = analogRead(tempsensor);
  TFTscreen.stroke(0 , 0 , 0);
  TFTscreen.setTextSize(1);
  TFTscreen.text("Tempature:\n ", 10, 40);
  TFTscreen.setTextSize(2);
  TFTscreen.text(temp, 10, 50);

(or maybe there's an overload for "TFTscreen.text" for "int"s, and I'm barking up the wrong tree.

  int temp = 0;
  TFTscreen.text(temp, 10, 50);

Apparently there is no version of .text() that takes an integer in place of a character string. You will probably have to convert your integer to a character string to display it on your TFT screen.

This example shows one way to do it:

I followed the instructions and This gets an error "Arduino: 1.5.6-r2 (Windows 8), Board: "Arduino Esplora"

google_glass.ino: In function 'void setup()':
google_glass:52: error: no matching function for call to 'TFT::text(String&, int, int)'
C:\Arduino\libraries\TFT\src/utility/Adafruit_GFX.h:174: note: candidates are: void Adafruit_GFX::text(const char*, int16_t, int16_t)

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences."

#define cs   10
#define dc   9
#define rst  8
#include <TFT.h>           
#include <SPI.h> 
TFT TFTscreen = TFT(cs, dc, rst);
char sensorPrintout[4];
int lightsensor = A1;
const int buttonone = 2;
const int buttontwo = 3;
const int buttonthree = 5;
int buttonos = 0;
int buttonts = 0;
int buttontrs = 0;

int light = 0;
void setup() {
  pinMode(buttonone, INPUT);
  pinMode(buttontwo, INPUT);
  pinMode(buttonthree, INPUT);
  Serial.begin(9600);
  TFTscreen.begin();
  TFTscreen.background(0 , 129 , 255);
  TFTscreen.stroke(254 , 254 , 0);
  TFTscreen.setTextSize(2);
  TFTscreen.text("Hi I am \n ", 0, 0);
  TFTscreen.text("GLASS\n ", 0, 16);
  TFTscreen.setTextSize(1);
  TFTscreen.stroke(0 , 0 , 0);
  TFTscreen.text("Weather:\n ", 10, 65);
  light = analogRead(lightsensor);
  if (light > 1000) {
  TFTscreen.fill(254 , 254 , 0);
  TFTscreen.circle(TFTscreen.width()/5.5,TFTscreen.height()/1.5, 10);
  delay(500);
  }
  else { 
  TFTscreen.stroke(0 , 0 , 148);
  TFTscreen.line(37, 95, 37, 77);
  TFTscreen.line(20, 96, 20, 79);
  TFTscreen.line(10, 92, 10, 74);
  TFTscreen.line(25, 96, 25, 78);
  TFTscreen.line(32, 86, 32, 70);
  }
  String sensorVal = String(analogRead(A0));
  sensorVal.toCharArray(sensorPrintout, 4);
  TFTscreen.stroke(0 , 0 , 0);
  TFTscreen.setTextSize(1);
  TFTscreen.text("Tempature:\n ", 10, 40);
  TFTscreen.setTextSize(2);
  TFTscreen.text(sensorVal, 10, 50);
}

So, don't convert to a String, convert to a string instead.

Thank you AWOL that fixed it :slight_smile: