Including Header Files

The compiler is a C++ compiler, and likes cpp files so much better.

I don't know it the compiler like C++ files better than C files but in this case it treats them the same.

MyBlink.cpp:1:21: warning: MyBlink.h: No such file or directory

Also the code is ANSI C code. That is why I gave it a C extension.

Why are you including Arduino.h in both the header file AND the source file? Isn't one enough?

I included the Arduino.h header because the MyBlink.h was not being included and therefore in order to get ONE I had to include it. I would like to have it only once. When I don't have it in the C/CPP file I get:

MyBlink.cpp:1:21: warning: MyBlink.h: No such file or directory
MyBlink.cpp: In function 'void BlinkFunction()':
MyBlink.cpp:2: error: 'LED_BUILTIN' was not declared in this scope
MyBlink.cpp:2: error: 'HIGH' was not declared in this scope
MyBlink.cpp:2: error: 'digitalWrite' was not declared in this scope
MyBlink.cpp:3: error: 'delay' was not declared in this scope
MyBlink.cpp:4: error: 'LOW' was not declared in this scope

So Arduino.h was added so as to not distract from the real problem.

Try replacing the <> in the include statements for your header file with "" instead.

That was a good suggestion and it worked.

Do we know why?