Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
duck
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jp7g21
duck
Commits
8155f8e8
Commit
8155f8e8
authored
3 years ago
by
jp7g21
Browse files
Options
Downloads
Patches
Plain Diff
Added text command
parent
351b1558
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
duck/duck.c
+4
-0
4 additions, 0 deletions
duck/duck.c
libduck/libduck.c
+5
-0
5 additions, 0 deletions
libduck/libduck.c
libduck/libduck.h
+1
-0
1 addition, 0 deletions
libduck/libduck.h
with
10 additions
and
0 deletions
duck/duck.c
+
4
−
0
View file @
8155f8e8
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
libduck/libduck.c
+
5
−
0
View file @
8155f8e8
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
libduck/libduck.h
+
1
−
0
View file @
8155f8e8
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment