I am making a program and arduino project, in which a front wheel and axle is controlled by a servo, and turning depending on the reading of one potentiometer, and the back wheel and axle controlled by the motor, which has its speed determined by another potentiometer. I made a program for this, and constructed the circuits, combining the servo circuit, 2 potentiometer circuits, and the motor circuit, all from the vilros arduino kit. As for my program, which practically combines the codes as well found on vilros.com, which can be downloaded, it keeps returning the error " stray '/302' in program ". Here is my program:
#include <Servo.h> // servo library
Servo servo1; // servo control object
void setup()
{
Serial.begin(9600);
servo1.attach(9);
} //error appears here
void loop()
{
int sensorValue = analogRead(A0);//reads servo petentiometer
// print out the value you read:
Serial.println(sensorValue);
delay(1);
servo1.write(sensorValue * 180L / 1023L); //servo output
int sensorValue2 = analogRead(A1);//reads motor petentiometer
// print out the value you read:
Serial.println(sensorValue2);
delay(1);
analogWrite(A2, (sensorValue2 * 130L / 1023L) + 125L); //motor output
}
Thanks for your solution
.