Need help it keeps saying 'not declared in scope' and I am lost at this point, I,ve tried everything to fix it and nothings working
/*
Robot Demo - Example 2
Drive in specific pattern using line counting navigation
*/
// SparkFun RedBot Library
#include <RedBot.h>
// create objects using classes in RedBot library
RedBotButton button;
RedBotMotors motors;
RedBotEncoder encoder(A2, 10);
RedBotSensor leftLine(A3);
RedBotSensor centerLine(A6);
RedBotSensor rightLine(A7);
// global variables for buzzer and LED pin numbers
const int buzzer = 9;
const int led = 13;
// global variables to keep track of which scenario to demonstrate
int scenario = 1;
boolean started = false;
void setup() {
pinMode(buzzer, OUTPUT);
pinMode(led, OUTPUT);
}
void loop() {
checkButton();
if (started == true) {
if (scenario == 1) scenario1();
else if (scenario == 2) scenario2();
else if (scenario == 3) scenario3();
const int followCountLine();
}
}
// CUSTOM FUNCTIONS
void scenario1() {
// Scenario 1: Drive from kitchen to Table 2, drive around table, and return to start
// drive from Start line to Table 2 line
followCountLine(2); // 2nd line will be path to Table 2
pivotAngle(-90); // pivot -90 angle = turn left
followCountLine(1); // next line is the circle around table
pivotAngle(-90);
alertSound(); // food is here!
followCountLine(1); // drive once around table
// turn and return to kitchen
pivotAngle(-90);
followCountLine(1); // next line is main path
pivotAngle(-90);
followCountLine(1); // next line is Start
alertSound(); // robot is ready for next order!
// set global variables for next scenario
scenario = 2;
started = false;
}
void scenario2() {
// add code for Scenario 2
// set global variables for next scenario
scenario = 3;
started = false;
// Scenario 1: Drive from kitchen to Table 2, drive around table, and return to start
// drive from Start line to Table 2 line
followCountLine(2); // 2nd line will be path to Table 2
pivotAngle(-90); // pivot -90 angle = turn left
followCountLine(1); // next line is the circle around table
pivotAngle(-90);
alertSound(); // food is here!
followCountLine(1); // drive once around table
// turn and return to kitchen
pivotAngle(-90);
followCountLine(1); // next line is main path
pivotAngle(-90);
alertSound(); // robot is ready for next order!
// set global variables for next scenario
scenario = 2;
started = false;
}
void scenario3() {
// add code for Scenario 3
// reset global variables for 1st scenario
scenario = 1;
started = false;
}
void checkButton() {
// add code for this custom function
}
void alertSound() {
Serial.print(left.read());
Serial.print("\t"); // tab character
Serial.print(center.read());
Serial.print("\t"); // tab character
Serial.print(right.read());
Serial.println();
if((left.read() > LINETHRESHOLD) && (center.read() > LINETHRESHOLD) && (right.read() > LINETHRESHOLD) )
{
motors.brake();
playNote(noteA3, WN);
delay(3000);
motors.leftMotor(leftSpeed);
motors.rightMotor(rightSpeed);
delay(200);
else
{
motors.leftMotor(leftSpeed);
motors.rightMotor(rightSpeed);
}
}
void followLine() {
// add code for this custom function
}
void followCountLine(int target) {
// add code for this custom function
}
void driveDistance(float distance, int power) {
// add code for this custom function
}
void pivotAngle(float angle) {
// add code for this custom function
}