Hi,
I’m a beginner in robotics, bought rover development platform kit for arduino (uno).
started up with wiring connection : arduino (connected to PC) + ext source for motor supply + 2 motors + Pololu low voltage dual serial motor controller.
Code downloaded to arduino:
//
[code]
int motor_reset = 2; //digital pin 2 assigned to motor reset
void setup()
{
pinMode(motor_reset, OUTPUT);
Serial.begin(9600);
digitalWrite(motor_reset, LOW);
delay(50);
digitalWrite(motor_reset, HIGH);
delay(50);
}
void loop()
{
motorforward();
}
//subroutine motor forward
void motorforward()
{
//left motor
unsigned char buff1[6];
buff1[0]=0x80; //start byte - do not change
buff1[1]=0x00; //Device type byte – do not change
buff1[2]=0x01; //Motor number and direction byte; motor one =00,01
buff1[3]=0x64; //Motor speed “0 to 128” in hex (ex 100 is 64 in hex)
for(int i=0; i<4; i++) {Serial.write(buff1*);}
//right motor
unsigned char buff2[6];
buff2[0]=0x80;
buff2[1]=0x00;
buff2[2]=0x03; //Motor number and direction byte; motor two=02,03
buff2[3]=0x64;
for(int i=0; i<4; i++) {Serial.write(buff2*);}
}[/code]
// …
Problem: motors not working!!
Question: Please, how can I know motor controller is not yet burnt?
Does problem come from the code?
Thanks**