Error finding HardwareSerial.h

Hi,

I am brand new to Arduino so apologies that this is probably a very simple issue.

I am pushing my code to arduino (rover car) and it is complaining that it cannot find a the hardwareSerial.h library. I don't know how to get it included in my library. I cannot find it in the library manager. Any help would be appreciated.

Error:

/tmp/600692549/SmartCar_Core_20200904/SmartCar_Core_20200904.ino:841:10: fatal error: hardwareSerial.h: No such file or directory
#include "hardwareSerial.h"
^~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Code Where the compilation is failing:

#include <IRremote.h>
#include <Servo.h>
#include <stdio.h>
#include "HardwareSerial.h"
#include "ArduinoJson-v6.11.1.h" //Use ArduinoJson Libraries

Why are you trying to include a standard part of the core? hardwareSerial is already included by default. Also you put it in quotes, which means it would have to be in your sketch folder.

All that you should need to be able to use the hardware serial is a Serial.begin(baud) function in setup() to initialize the Serial port.

What Arduino board are you using?

Thank you for your responses. The code is actually the code provided by my Elegoo Smart robot 3.0. I purchased it to o with my son, I installed the first lesson (successfully) an then tried to revert back to the fully installed working robot (to confirm that I can always recover). I didn't actually write the code but I attached it here.

I am not a C/C++ expert but did think that the local reference was odd.

My board is an Uno Rev 3 but it all came as part of this kit. Amazon.com

Thanks again

SmartCar_Core_20200904.zip (35.3 KB)

Using quotes should still search the default library folders if not found in the sketch folder. Unfortunately the library file starts with a capital letter, so would not match if the operating system is case-sensitive.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.