NO SUCH FILE OR DIRECTORY

Testing headers because I am not so sure I understand how they work but this is what I am getting:

Arduino: 1.6.5 (Mac OS X), Board: “Arduino/Genuino Uno”

arduino.cpp.ino:1:23: fatal error: arduino.cpp: No such file or directory
compilation terminated.
Error compiling.

I have a folder named arduino.cpp and inside it a sketch named arduino.cpp, but when I try to include it even though it is not necessary, errors always appear. Thank you! Heroes my simple code testing it:

//testing headers

#include “arduino.cpp”

#include

void setup()

{

pinMode(13, OUTPUT);

pinMode(12, OUTPUT);

}

void loop()

{

digitalWrite(13, HIGH);

digitalWrite(12, HIGH);

delay(2000);

digitalWrite(13, LOW);

digitalWrite(12, LOW);

delay(2000);

}

The folder name shouldn't have the file extension in the name. The file you're including should be a header, not a source file. You include .h files, not .cpp.

  1. Do not include .cpp files, you include .h files
  2. "Arduino" is a special name - it's the name of one of the files in the core, which you shouldn't be messing with unless you really know what you're doing. If you're writing and including your own library, name it something else. If the file we're looking at is your Arduino.cpp - sketches should have .ino extension, sketches don't have to include themselves, and you can't name your sketch Arduino, that's a special name.

Ok. Both of you thank you. I noticed I did have the info extension along with cpp so I will restart with another name, and a .h file with no info extension.

Hi. I learned earlier that for what I was doing I must use a .h file in order to #include a “header.” However, I realized my file in the error showed the file had a .ino extension. How do I get it so that is not there. Thank you! Here is my code and error.

#include “second.h”
#include <second.h>

int main();

int LED = 13;
int ETHAN = 12;

void setup()

{
pinMode(LED,OUTPUT);
pinMode(ETHAN,OUTPUT);
}

void loop()

{
digitalWrite(LED,HIGH);
digitalWrite(ETHAN,HIGH);
delay(2500);
digitalWrite(LED,LOW);
digitalWrite(ETHAN,LOW);
delay(2500);
}

Arduino: 1.6.5 (Mac OS X), Board: “Arduino/Genuino Uno”

second.h.ino:1:20: fatal error: second.h: No such file or directory
compilation terminated.
Error compiling.

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

What is the purpose of this:
int main();?

Also, nothing in your sketch references anything that would have to be in a header file.

Essentially identical threads merged.

#include "second.h"
#include <second.h>

Why 2 includes ?
The first one will look for the file in the same folder as the program. The second one will look for a folder named second in one of the Arduino library folders then, if it finds the folder it will look for the file in the folder.

Where exactly do you have second.h ?