#batista1987
Yes the shield uses pin 9 and 10 normall. But I had to use pin 9 and 10 for 20kHz pwm output, so I rerouted them to pin 7 and 8.
Here is a list of the pins I used:
pin 0 (PD0) = left motor logic A - output
pin 1 (PD1) = left motor logic B - output
pin 2 (PD2) = fist encoder input A - input
pin 3 (PD3) = fist encoder input B - input
pin 4 (PD4) = second encoder input A - input
pin 5 (PD5) = second encoder input B - input
pin 6 (PD6) = buffer (used to indicated when finished calibration) - output
pin 7 (PD7) = INT of USB Host Shield - input
pin 8 (PB0) = SS of USB Host Shield - output
pin 9 (PB1) = left motor pwm (OC1A) - output
pin 10 (PB2) = right motor pwm (OC1B) - output
pin 11 (PB3) = MOSI for USB Host Shield - output
pin 12 (PB4) = MISO for USB Host Shield - input
pin 13 (PB5) = SCK for USB Host Shield - output
pin 14 - A0 (PC0) = gyro y-axis - input
pin 15 - A1 (PC1) = accelerometer x-axis - input
pin 16 - A2 (PC2) = accelerometer y-axis - input
pin 17 - A3 (PC3) = accelerometer z-axis - input
pin 18 - A4 (PC4) = right motor logic A - output
pin 19 - A5 (PC5) = right motor logic B - output
As you can see the reason why I the analog pin for the motor is because I had used all other pins - remember that an analog pin can also be used as a general I/O.
You could actually save two pin, as your IMU uses I2C while mine is analog. If I had to order a new one, I would also go for a digital IMU to save more pins.
There is no difference in the below:
#define rightA PINC4 // PC4 - pin A4
#define rightB PINC5 // PC5 - pin A5
to
Code:
#define rightA PINC4 // PC3 - pin A3
#define rightB PINC5 // PC2 - pin A2
You have only edited the comment NOT the pins definition. The right approach would be:
#define rightA PINC3 // PC3 - pin A3
#define rightB PINC2 // PC2 - pin A2
Regards
Lauszus