Hello, I am getting the following errors on my ball_and_beam_pid project.
F:\myArduino\Ball_Beam_Servo\ball_and_beam\ball_and_beam.ino:36:1: error: 'HCSR04' does not name a type
HCSR04 sensor(TRIG_PIN, ECHO_PIN);
^~~~~~
F:\myArduino\Ball_Beam_Servo\ball_and_beam\ball_and_beam.ino: In function 'void readSensor()':
F:\myArduino\Ball_Beam_Servo\ball_and_beam\ball_and_beam.ino:74:20: error: 'sensor' was not declared in this scope
double reading = sensor.dist();
^~~~~~
F:\myArduino\Ball_Beam_Servo\ball_and_beam\ball_and_beam.ino:74:20: note: suggested alternative: 'perror'
double reading = sensor.dist();
^~~~~~
perror
exit status 1
Compilation error: 'HCSR04' does not name a type
Here are my included files:
#include "PID_v1.h"
#include "HCSR04.h"
#include <AccelStepper.h>
#include "SimpleKalmanFilter.h"
I downloaded the HCSR04.h and HCSR04.cpp and zipped them up and included the zip in my project.
ball_and_beam.zip (12.8 KB)
What am I doing wrong?
Thank you very much,
Joe