Go Down

Topic: Problems with includes using Eclipse as IDE (Read 4447 times) previous topic - next topic

r0oland

Hello,

I am trying to use my Arduino with the Eclipse IDE but somehow I am not able to use the command #include <LiquidCrystal.h>

A simple example like Blink works just fine, but if I try to compile the following little code, I got an error.
Code: [Select]

#include "WProgram.h"

#include <LiquidCrystal.h>

int main(void) {

  /* Must call init for arduino to work properly */
  init();

  /****************************/
  /* Add your setup code here */
  /****************************/
  pinMode(13, OUTPUT);
  LiquidCrystal lcd(7, 5, 4, 3, 2, 1);

  for (;;) {

    /****************************/
    /*** write main loop here ***/
    /****************************/
digitalWrite(13, HIGH);   // set the LED on
delay(200);              // wait for a second
digitalWrite(13, LOW);    // set the LED off
delay(200);              // wait for a second

  } // end for

} // end main


As Error I get
Quote
expected '=', ',', ';', 'asm' or '__attribute__' before 'lcd'


Has anyone any idea what is going on?

endoracing

From looking at the syntax for LiquidCrystal() it looks like your line should be:

LiquidCrystal(7, 5, 4, 3, 2, 1);

instead of:

LiquidCrystal lcd(7, 5, 4, 3, 2, 1);

r0oland

Nope, this should be correct. Works fine with the Arduino IDE tough...

Any other idea?

endoracing

is the file main.c or main.cpp ? My first though was that it looks like the errors I get if I try to compile a C++ file with the C compiler.

If that's not it someone more familiar will have to help you out.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy