debugging
This commit is contained in:
@@ -232,9 +232,9 @@ void DW640::setMotorSpeed(uint8_t motor, int16_t speed) {
|
|||||||
}
|
}
|
||||||
// Speed deciphering for the two control modes
|
// Speed deciphering for the two control modes
|
||||||
if( speed >= 1000 && speed < 1500 ) {
|
if( speed >= 1000 && speed < 1500 ) {
|
||||||
printf( "%d - %d", speed, map(speed, 1500, 1000, 0, 255 ) );
|
printf( "%d - %d\n", speed, map(speed, 1500, 1000, 0, 255 ) );
|
||||||
} else if( speed > 1500 && speed <= 2000 ) {
|
} else if( speed > 1500 && speed <= 2000 ) {
|
||||||
printf( "%d - %d", speed, map(speed, 1500, 2000, 0, 255 ) );
|
printf( "%d - %d\n", speed, map(speed, 1500, 2000, 0, 255 ) );
|
||||||
} else if( speed > 0 && speed <= 255 ) {
|
} else if( speed > 0 && speed <= 255 ) {
|
||||||
runMotor( DW_FORWARD, in1, in2, speed );
|
runMotor( DW_FORWARD, in1, in2, speed );
|
||||||
} else if( speed < 0 && speed >= -255 ) {
|
} else if( speed < 0 && speed >= -255 ) {
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ int main()
|
|||||||
dw.setMotorSpeed( 1, 1500 );
|
dw.setMotorSpeed( 1, 1500 );
|
||||||
printf("forward\n");
|
printf("forward\n");
|
||||||
dw.setMotorSpeed( 1, 2000 );
|
dw.setMotorSpeed( 1, 2000 );
|
||||||
|
dw.setMotorSpeed( 1, 1800 );
|
||||||
|
dw.setMotorSpeed( 1, 1700 );
|
||||||
|
dw.setMotorSpeed( 1, 1600 );
|
||||||
|
dw.setMotorSpeed( 1, 1550 );
|
||||||
usleep(5000000);
|
usleep(5000000);
|
||||||
printf("stop\n");
|
printf("stop\n");
|
||||||
dw.setMotorSpeed( 1, 1500 );
|
dw.setMotorSpeed( 1, 1500 );
|
||||||
|
|||||||
Reference in New Issue
Block a user