Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BrainCrorp Firmware Code Challenge
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
esc2
BrainCrorp Firmware Code Challenge
Commits
4a92dc85
Commit
4a92dc85
authored
6 years ago
by
esc2
Browse files
Options
Downloads
Patches
Plain Diff
Update Distinguish.c
parent
6829b7b2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Distinguish.c
+2
-1
2 additions, 1 deletion
Distinguish.c
with
2 additions
and
1 deletion
Distinguish.c
+
2
−
1
View file @
4a92dc85
...
@@ -59,7 +59,8 @@ void Distinguish(uint8_t *data){
...
@@ -59,7 +59,8 @@ void Distinguish(uint8_t *data){
else
if
(
message_type
==
0x80
){
//messagetpye = motor
else
if
(
message_type
==
0x80
){
//messagetpye = motor
int32_t
forwardback
=
0
;
int32_t
forwardback
=
0
;
int32_t
leftright
=
0
;
int32_t
leftright
=
0
;
for
(
int
i
=
0
;
i
<
4
;
i
++
){
//loop places data bytes into right
int
i
=
0
;
for
(
i
=
0
;
i
<
4
;
i
++
){
//loop places data bytes into right
forwardback
+=
*
(
data
+
4
+
i
);
//spot
forwardback
+=
*
(
data
+
4
+
i
);
//spot
leftright
+=
*
(
data
+
8
+
i
);
leftright
+=
*
(
data
+
8
+
i
);
if
(
i
!=
3
){
if
(
i
!=
3
){
...
...
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