I keep getting an error code on lesson ten that says error compiling for board. Does anyone think they could help me out with this?
Most of us have no idea what lesson 10 is.
Please provide your code; just in case, please read How to use this forum - please read, specifically point #7 about posting code using code tags.
2)
Please provide the full error message. When you get an error, there will be a button at the right top of the output window to copy the error message. Click that to copy the error message to the clipboard and next paste the error here.
3)
Although usually less important, which OS and which version of the IDE.
PS
The subtitle of the forum section where you posted this is For problems with Arduino itself, NOT your project. Compile errors usually fit better in the programming section. I will ask a moderator to move it.
is it this Lesson 10 or that one or may be this other one unless it is potentially something like this... ?
I keep getting the error code that looks like this.
Arduino: 1.8.10 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
SR04_Example:3:10: error: SR04.h: No such file or directory
#include "SR04.h"
^~~~~~~~
compilation terminated.
exit status 1
SR04.h: No such file or directory
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Does anybody think they could help me out?
(deleted)
You already had inswers in Lesson 10 errors - Programming Questions - Arduino Forum.
Why did you start another thread?
@swordslasher055, do not cross-post. Threads merged.
Following on this "Did you follow the instructions to install the SR04 library?" how would you do this? Where would I go?
this is the code that I tried to add to the library
#include <hcsr04.h>
#define TRIG_PIN 12
#define ECHO_PIN 13
HCSR04 hcsr04(TRIG_PIN, ECHO_PIN, 20, 4000);
void setup(){
Serial.begin(9600);
}
void loop() {
Serial.println(hcsr04.ToString());
delay(250);
}
This the error I got from this code
Arduino: 1.8.10 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
C:\Users\rafor\AppData\Local\Temp\cciOoBtg.ltrans0.ltrans.o: In function `main':
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to `setup'
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:46: undefined reference to `loop'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Could anyone help?
swordslasher055:
this is the code that I tried to add to the library#include <hcsr04.h>
That # line doesn't "add" the library to the system, in the sense of "installing" it. It simply makes a previously installed library visible to your code.
In the IDE go Sketch / Include library / Manage libraries and put hcsr04 in Filter your search. That might be the right library. (But of course there can be many libraries with the same name....)
Go More Info and the Install button will appear.