Hi all,
I am using AVR128 to control differential steering robots. I have done a code but it does not work. Any body can give me commments and correction:
/// Configuration for dual motor controller
void initMotorsConfiguration()
{
//Set reset pint
DDRE = 0b00000100;
PORTE = 0b00000100;
_delay_ms(20);
// Configuraiton
putcharUART0(0x80); // startbyte
putcharUART0(0x02); // change configuration
putcharUART0(0x02); // new settings
// reset
DDRE = 0x00;
PORTE = 0x00;
_delay_ms(20);
// set as active mode of motors
DDRE = 0b00000100;
PORTE = 0b00000100;
_delay_ms(20);
// send maximum speed to two motors
void robotMotion()
{
putcharUART0(0x80);
putcharUART0(0x00);
putcharUART0(0x50);
putcharUART0(0x7F);
}
// Here, putcharUART0 is the function of serial commmunication to send each char value to the motor controller.
Thanks in advance.