Line following

Hi guys, fist of all sorry for my English, im Spanish and is so bad.
I’m doing a proyect for the college of a line follower and not compile my Arduino code. I’m using the code that is implemented in examples robot control.

Arduino:1.6.4 (Linux), Placa:"Arduino Duemilanove or Diecimila, ATmega328"

Opciones de compilación cambiadas, reconstruyendo todo
sketch_may29a.ino: In function 'void setup()':
sketch_may29a:14: error: a function-definition is not allowed here before '{' token
a function-definition is not allowed here before '{' token

  This report would have more information with
  "Show verbose output during compilation"
  activala desde Archivo > Preferencias

Thank you mates.

Post your code, not just the error message.

#include <ArduinoRobot.h> // include the robot library
#include <Wire.h>
#include <SPI.h>

long timerOrigin; // used for counting elapsed time

void setup() {
  // initialize the Robot, SD card, display, and speaker

  // show the logots on the TFT screen

  Robot.drawBMP("lf.bmp", 0, 0); // display background image

  Robot.playFile("chase.sqm");  // play a song from the SD card

  // add the instructions
  Robot.text("Line Following\n\n place the robot on\n the track and \n see it run", 5, 5);
  Robot.text("Press the middle\n button to start...", 5, 61);

  // These are some general values that work for line following
  // uncomment one or the other to see the different behaviors of the robot
  //Robot.lineFollowConfig(14, 9, 50, 10);
  Robot.lineFollowConfig(11, 7, 60, 5);

  //set the motor board into line-follow mode

  // start
  Robot.fill(255, 255, 255);
  Robot.stroke(255, 255, 255);
  Robot.rect(0, 0, 128, 80); // erase the previous text
  Robot.stroke(0, 0, 0);
  Robot.text("Start", 5, 5);

  Robot.stroke(0, 0, 0); // choose color for the text
  Robot.text("Time passed:", 5, 21); // write some text to the screen

  timerOrigin = millis(); // keep track of the elapsed time

  while (!Robot.isActionDone()) { //wait for the finish signal
    Robot.debugPrint(millis() - timerOrigin, 5, 29); // show how much time has passed

  Robot.stroke(0, 0, 0);
  Robot.text("Done!", 5, 45);
void loop() {
  //nothing here, the program only runs once. Reset the robot
  //to do it again!