Update motor test tool

This commit is contained in:
Lorenz Meier
2014-11-13 10:31:16 +01:00
5 changed files with 64 additions and 15 deletions
+6 -4
View File
@@ -79,8 +79,9 @@ void motor_test(unsigned channel, float value)
static void usage(const char *reason)
{
if (reason != NULL)
if (reason != NULL) {
warnx("%s", reason);
}
errx(1,
"usage:\n"
@@ -91,8 +92,9 @@ static void usage(const char *reason)
int motor_test_main(int argc, char *argv[])
{
unsigned long channel, lval;
float value;
unsigned long channel = 0;
unsigned long lval;
float value = 0.0f;
int ch;
if (argc != 5) {
@@ -123,7 +125,7 @@ int motor_test_main(int argc, char *argv[])
motor_test(channel, value);
printf("motor %d set to %.2f\n", channel, value);
printf("motor %d set to %.2f\n", channel, (double)value);
exit(0);
}