diff --git a/darkwater/DW640.cpp b/darkwater/DW640.cpp index 4f8236d..420de95 100644 --- a/darkwater/DW640.cpp +++ b/darkwater/DW640.cpp @@ -232,9 +232,9 @@ void DW640::setMotorSpeed(uint8_t motor, int16_t speed) { } // Speed deciphering for the two control modes 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 ) { - 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 ) { runMotor( DW_FORWARD, in1, in2, speed ); } else if( speed < 0 && speed >= -255 ) { diff --git a/examples/Motor/Motor.cpp b/examples/Motor/Motor.cpp index d09dd6c..0107d91 100644 --- a/examples/Motor/Motor.cpp +++ b/examples/Motor/Motor.cpp @@ -30,6 +30,10 @@ int main() dw.setMotorSpeed( 1, 1500 ); printf("forward\n"); dw.setMotorSpeed( 1, 2000 ); + dw.setMotorSpeed( 1, 1800 ); + dw.setMotorSpeed( 1, 1700 ); + dw.setMotorSpeed( 1, 1600 ); + dw.setMotorSpeed( 1, 1550 ); usleep(5000000); printf("stop\n"); dw.setMotorSpeed( 1, 1500 );