Can someone help, whenever I verify this code it always displays the error message "exit status 1
a function-definition is not allowed here before '{' token" it is right after void loop.
int throttlePin = A0; //conected to potentiometer conected to 5v
int steeringPin = A1; //conected to potentiometer conected to 5v
int track1Pin = A2;
int track2Pin = A3;
int revPin1 = 2;
int revPin2 = 3;
int value1 = 0;
int value2 = 0;
int value3 = 0;
int value4 = 0;
int value5 = 0;
int value6 = 0;
int value7 = 0;
int value8 = 0;
void setup() {
// put your setup code here, to run once:
pinMode(revPin1, OUTPUT);
pinMode(revPin2, OUTPUT);
void loop(){
analogWrite(value1 = analogRead(steeringPin - 127.5));
delay(1);
value2 = analogRead(value1 * -1);
delay(1);
if (analogRead(value1 > 0))
{
analogWrite(value3, (analogRead(throttlePin) + (analogRead(value2))));
analogWrite(value4, (analogRead(throttlePin) + (analogRead(value1))));
}
else
{
analogWrite(value3, (analogRead(throttlePin) + (analogRead(value1))));
analogWrite(value4, (analogRead(throttlePin) + (analogRead(value2))));
}
delay(1);
if ( analogRead(value3 > 255))
{
analogWrite(value5, value3 - (value3 - 255));
analogWrite(value6, value4 - (value4 - 255));
}
else
{
analogWrite(value5, value3);
}
if ( analogRead(value4 > 255))
{
analogWrite(value6, value4 - (value4 - 255));
analogWrite(value5, value3 - (value3 - 255));
}
else
{
analogWrite(value6, value4);
}
analogWrite(track1Pin, analogRead(value5));
analogWrite(track2Pin, analogRead(value6));
value7 = map(trackPin1, -255, 255, -100, -100);
value8 = map(trackPin2, -255, 255, -100, -100);
}