error #include expects "FILENAME" or <FILENAME>

Hello
I did my first class following this tutorial: http://playground.arduino.cc/Code/Library

If I declare my header:
#include <M_LEDBLINK.h>
or
#include </usr/share/arduino/libraries/Personal/M_LEDBLINK.h>

also doing the same with “M_LEDBLINK.h”

I get an error:
error #include expects “FILENAME” or

Any succsestion?
Thanks Martin

Any succsestion?

Besides "learn to spell"?

There is a sticky (two, actually) at the top of the forum. I'm sure that if you read them, something will occur to you.

If that doesn't happen, here's a hint: POST YOUR CODE!

I don't get it so here is my code:

// my header:
#ifndef _M_LEDBLINK_H
#define _M_LEDBLINK_H

#include Arduino.h

class M_LEDBLINK{

public:
M_LEDBLINK();
~M_LEDBLINK();
void ledOn();
void ledOff();
void ledBlink(int time);
};
#endif
//

//my cpp
#include "M_LEDBLINK.h"

const byte LED_PIN=12;

M_LEDBLINK::M_LEDBLINK(){

pinMode(LED_PIN, OUTPUT);
}

M_LEDBLINK::~M_LEDBLINK(){/nothing to destruct/}

void M_LEDBLINK::ledOff(){

digitalWrite(LED_PIN,LOW);

}

void M_LEDBLINK::ledOn(){

digitalWrite(LED_PIN,HIGH);

}
void M_LEDBLINK::ledBlink(){

ledOn();
delay(time/2);
ledOff();
delay(time/2);
}
//
//
Thanks Martin

I think this is what it is complaining about

#include Arduino.h

It should be this

#include <Arduino.h>
#include Arduino.h

So, is there some part of “the file name needs to be in “” of <>” that you don’t understand?

Uff, thanks

hi, can you please help. i get the following message, “expected unqualified-id before ‘{’ token,” when writing the following code
.
.
.
.
.
.
.

{
void setup()
// put your setup code here, to run once:
#define pingTrig 6
#define pingEcho 7

#include <Servo.h>

Servo myservo;

void setup()
{
pinMode(pingTrig, OUTPUT);
pinMode(pingEcho, INPUT);
myservo.attach(9);
}

void loop()
{
long duration, inches, cm;

digitalWrite(pingTrig, LOW);
delayMicroseconds(2);
digitalWrite(pingTrig, HIGH);
delayMicroseconds(10);
digitalWrite(pingTrig, LOW);

duration = pulseIn(pingEcho, HIGH);

cm = duration / 29 / 2;

if(cm < 10 ){
myservo.write(90);
delay(100);
}else{
myservo.write(0);
}
delay(2000);
}
}

void loop() {
// put your main code here, to run repeatedly:

}

Why is there a { before setup()?

@drumanart, after 15 posts on these forums, you should be aware that you must post your code between code tags.

And @ozmame2, you did two things wrong:-

  1. Same as above.
  2. You’re hijacking someone else’s thread. That is bad form on any forum. Please start your own thread, and when you do, post your code between code tags.

See PaulS and SurferTim’s posts for an example.

In the reply window, code tags are found by clicking on the </> button in the “Reply” window.

And an Arduino program doesn’t like two ‘setup()’ and two ‘loop()’ functions.

@ozmame2

You should start your own thread.

#define and #include don’t belong in any fuction; place them at the top of your code. You also have two times setup() and loop(); you can only have one of each.

My arduino program isn’t working because #include needs to have a FILENAME and when i put OR “FILENAME” it doesn’t work, What should i do?

NicoleBackal:
My arduino program isn’t working because #include needs to have a FILENAME and when i put OR “FILENAME” it doesn’t work, What should i do?

  • Google it (probably did that)
  • see if you can make sense out of the things that have been said. (probably not, since you missed a fairly important point that was being made)
  • Start your own thread and be as complete and accurate as possible, post your code in code tags.