I am teaching a robotics class using Arduino micro controller. I purchase the Ardumoto Shield Kit and used the sample code to attach my hobby motors. Here is the link to the sample code (https://learn.sparkfun.com/tutorials/ar … 1548205576).
The sample code has different codes to drive the motors and when I try to copy a portion of the code into a new sketch I get a error message stating that the setupArdumoto (); was not declared in this scope. I copied all the #define info from the sample sketch into the new sketch and the void setup code.
I am fairly new with coding and I do not understand what I am supposed to do. Any assistance is appreciated
Yes the sketch works when you load into the IDE. But there are different codes and the I only want to use the
// Drive both
driveArdumoto(MOTOR_A, FORWARD, 255); // Motor A at max speed.
driveArdumoto(MOTOR_B, FORWARD, 255); // Motor B at max speed.
delay(1000); // Drive forward for a second
// Now go backwards at half that speed:
driveArdumoto(MOTOR_A, REVERSE, 127); // Motor A at max speed.
driveArdumoto(MOTOR_B, REVERSE, 127); // Motor B at max speed.
delay(1000); // Drive forward for a second
I copied all the commands above the void setup and pasted into a new sketch, then I pasted the //DRIVE BOTH into the void loop and I get an error that the setupArdumoto(); is not defined.