Undefined reference to 'loop'

Ok, so I have asked this before, except I know the answer, at least, I thought I did.

So here's my code.

#include <TFT.h> // Hardware-specific library
#include <SPI.h>
#include <Esplora.h>

void setup(){
  EsploraTFT.begin();  
  EsploraTFT.background(0,0,0); // clear the screen
  EsploraTFT.stroke(255,0,255);
  // static text
  EsploraTFT.text("RetroMod",0,0);
  EsploraTFT.text("Mobile",0,30);  
  // increase font size for text in loop() 
  EsploraTFT.setTextSize(3);
delay(1000);

void loop();
}

Now I'm trying to get it to display a menu screen style thing, and while I'm still probably doing this wrong anyways, it gives me the error "undefined reference to Loop". Now the last time I asked this question, the answer turned out to be that I needed a void loop. So i put one at the bottom. However it's still giving me the same error.

WHAT AM I DOING WRONG!!

the

void loop();

is a function prototype and not the dec of the function. Just rop the ;

Mark

No silly! Loop is a separate function to setup and has to be defined OUTSIDE the setup function :slight_smile:

This would be closer

#include <TFT.h> // Hardware-specific library
#include <SPI.h>
#include <Esplora.h>

void setup(){
  EsploraTFT.begin();  
  EsploraTFT.background(0,0,0); // clear the screen
  EsploraTFT.stroke(255,0,255);
  // static text
  EsploraTFT.text("RetroMod",0,0);
  EsploraTFT.text("Mobile",0,30);  
  // increase font size for text in loop() 
  EsploraTFT.setTextSize(3);
delay(1000);
}

void loop();
{}

This would be closer

But not close enough. Now, if you remove the ; after the () on the void loop(); line, you'd be there.

PaulS:
But not close enough. Now, if you remove the ; after the () on the void loop(); line, you'd be there.

Agh, Copy and paste.... :slight_smile:

Hey guys thanks. One more thing, (If you can't tell i'm a total n00b at all of this) How would you increase the font size? Cuz when I tried

#include <TFT.h> // Hardware-specific library
#include <SPI.h>
#include <Esplora.h>

void setup(){
  EsploraTFT.setTextSize(100);
  EsploraTFT.begin();  
  EsploraTFT.background(0,0,0); // clear the screen
  EsploraTFT.stroke(255,0,255);
  // static text
  EsploraTFT.text("RetroMod",50,0);
  EsploraTFT.text("Mobile",50,10);  
delay(1000);
}

void loop()
{}[code]

It doesn't increase the size at all. Any ideas?
EsploraTFT.setTextSize(100);

What does the setTextSize() method take as a parameter ?

#include <TFT.h> // Hardware-specific library

See that comment? Can you find where you've told us anything about the hardware, other than that it is attached to an Esplora?