Hi,
I am attempting to manage two DC motors using a Sparkfun TB6612FNG. I just started writing a sketch for it but I keep getting this weird error:
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.6 (Windows NT (unknown)), Board: "Arduino Uno"
progetto-velocita.ino:5: error: expected identifier before ')' token
progetto-velocita.ino:25: error: expected identifier before ')' token
My sketch looks ok. Here it is:
// Motor control pins
// Motor A
const int PWMA = 3; // Speed
const int AIN1 = 9; // Direction
const int AIN2 = 8; // Direction
// Motor B
const int PWMB = 5; // Speed
const int BIN1 = 11; // Direction
const int BIN2 = 12; // Direction
// This is used to define wheter
// the motor controller should work or not
const int STBY = 10;
// Used to set motor's standby status
void setStandby(boolean state) {
digitalWrite(STBY, state ? LOW : HIGH);
}
// Used to drive motors:
// - motors: can be 0 (motor A), 1 (motor B), 2 (both)
// - mDirection: can 0 for clockwise motion, 1 otherwise
// - mSpeed: motor speed from 0 to 255
void drive(int motors, int mDirection, int mSpeed,) {
return;
}
void setup() {
// Setup motor s mode
pinMode(PWMA, OUTPUT);
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);
pinMode(PWMB, OUTPUT);
pinMode(BIN1, OUTPUT);
pinMode(BIN2, OUTPUT);
pinMode(STBY, OUTPUT);
}
void loop() {
}
What am I doing wrong?