Stop_Motor_Right();
PARA;
Reverse_Motor_Left( vel );
Reverse_Motor_Right( vel );
PARA;
Stop_Motor_Left();
Stop_Motor_Right();
PARA;
}
void Stop_Motor_Left( void )
{
digitalWrite( MOTOR_IZDO_DIR , LOW );
digitalWrite( MOTOR_IZDO_SPD , LOW );
}
void Stop_Motor_Right( void )
{
digitalWrite( MOTOR_DCHO_DIR , LOW );
digitalWrite( MOTOR_DCHO_SPD , LOW );
}
void Forward_Motor_Left( int velocidad )
{
digitalWrite( MOTOR_IZDO_DIR, HIGH );
analogWrite( MOTOR_IZDO_SPD, 255-velocidad );
}
void Forward_Motor_Right( int velocidad )
{
digitalWrite( MOTOR_DCHO_DIR, HIGH );
analogWrite( MOTOR_DCHO_SPD, 255-velocidad );
}
void Reverse_Motor_Left( int velocidad )
{
digitalWrite( MOTOR_IZDO_DIR, LOW );
analogWrite( MOTOR_IZDO_SPD, velocidad );
}
void Reverse_Motor_Right( int velocidad )
{
digitalWrite( MOTOR_DCHO_DIR, LOW );
analogWrite( MOTOR_DCHO_SPD, velocidad );
}
Hispalis RobIOTics Arduino Trainer v1.0
Hispalis RobIOTics Arduino Trainer v1.0
Página
14
de
31
Página
14
de
31