Commit 8155f8e8 authored by jp7g21's avatar jp7g21
Browse files

Added text command

parent 351b1558
......@@ -91,6 +91,10 @@ int main(int argc, char **argv)
shake(MOTOR_2, numnods, -90, 0, 250);
i++;
}
} else if (strcmp(argv[i], "print") == 0) {
if (argv[i+1]) {
duck_write_text(argv[i+1]);
}
}
}
if (read_mode) {
......
......@@ -88,6 +88,11 @@ int duck_set_velocity(int motor, int deg_per_sec, int ms)
return duck_printf("v %d %d %d\n", motor, deg_per_sec, ms);
}
int duck_write_text(const char *str)
{
return duck_printf("t %s\n", str);
}
void read_duck_to_stdout(void)
{
while (1) {
......
......@@ -16,6 +16,7 @@ void configure_duck(void);
int duck_set_position(int motor, int angle);
int duck_delay(int ms);
int duck_set_velocity(int motor, int deg_per_sec, int ms);
int duck_write_text(const char *str);
void read_duck_to_stdout(void);
void close_duck(void);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment