Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
car-controlserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenzhongjian
car-controlserver
Commits
00fa0103
Commit
00fa0103
authored
Nov 20, 2025
by
957dd
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/modify_0206' into 'master'
修改了水坦克的控制 See merge request
!88
parents
3dc5c345
d13f72bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
47 deletions
+84
-47
main
build/main
+0
-0
tank0206_control.c
drivers/devicecontrol/tank0206_control.c
+84
-47
No files found.
build/main
View file @
00fa0103
No preview for this file type
drivers/devicecontrol/tank0206_control.c
View file @
00fa0103
...
@@ -79,59 +79,96 @@ void tank0206_mode_right_back(unsigned char gval) {
...
@@ -79,59 +79,96 @@ void tank0206_mode_right_back(unsigned char gval) {
}
}
}
}
int
tank0206_change_grading
(
int
mode
){
int
mode_val
=
0
;
switch
(
mode
){
case
2
:
mode_val
=
10
;
break
;
case
3
:
mode_val
=
20
;
break
;
case
4
:
mode_val
=
40
;
break
;
case
5
:
mode_val
=
50
;
break
;
case
6
:
mode_val
=
60
;
break
;
case
7
:
mode_val
=
70
;
break
;
default
:
break
;
}
return
mode_val
;
}
void
tank0206_change
(
unsigned
char
*
buf
)
{
void
tank0206_change
(
unsigned
char
*
buf
)
{
unsigned
char
type
=
buf
[
0
];
unsigned
char
mode
=
buf
[
1
];
unsigned
char
mode
=
buf
[
1
];
unsigned
char
val
=
buf
[
2
];
unsigned
char
val
=
buf
[
2
];
static
int
modecount_tank0206
=
0
;
static
int
tank0206_index
=
0
;
static
int
tank0206_steering_t
=
0
;
if
(
mode
==
1
)
{
static
int
tank0206_front_t
=
0
;
tank0206_mode_lift_flont
(
val
);
tank0206_mode_right_flont
(
val
);
static
int
tank0206_front_val
=
0
;
modecount_tank0206
=
0
;
static
int
tank0206_steering_val
=
0
;
}
else
if
(
mode
==
2
)
{
tank0206_mode_lift_back
(
val
);
int
tank0206_count
=
30
;
tank0206_mode_right_back
(
val
);
modecount_tank0206
=
1
;
if
(
type
!=
1
)
tank0206_count
=
tank0206_change_grading
(
type
);
}
if
((
mode
==
1
||
mode
==
2
)
&&
val
==
0
)
tank0206_front_t
=
0
;
if
((
mode
==
1
||
mode
==
2
)
&&
val
==
0
)
{
if
((
mode
==
3
||
mode
==
4
)
&&
val
==
0
)
tank0206_steering_t
=
0
;
modecount_tank0206
=
0
;
tank0206_index
=
0
;
if
(
mode
==
1
&&
val
!=
0
)
{
tank0206_front_val
=
val
;
tank0206_front_t
=
1
;
}
else
if
(
mode
==
2
&&
val
!=
0
)
{
tank0206_front_t
=
2
;
tank0206_front_val
=
val
;
}
}
if
((
mode
==
1
||
mode
==
2
)
&&
val
!=
0
)
{
tank0206_index
=
1
;
if
(
mode
==
3
&&
val
!=
0
)
{
tank0206_steering_t
=
1
;
tank0206_steering_val
=
val
;
}
else
if
(
mode
==
4
&&
val
!=
0
)
{
tank0206_steering_t
=
2
;
tank0206_steering_val
=
val
;
}
}
if
(
mode
==
3
)
{
if
(
tank0206_front_t
==
0
&&
tank0206_steering_t
==
0
){
if
(
modecount_tank0206
==
0
)
{
tank0206_mode_lift_flont
(
0
);
//tank0206_mode_lift_back(val+10);
tank0206_mode_right_flont
(
0
);
if
(
tank0206_index
==
1
)
tank0206_mode_right_flont
(
0
);
}
else
if
(
tank0206_front_t
==
1
&&
tank0206_steering_t
==
0
){
else
{
tank0206_mode_lift_flont
(
tank0206_front_val
);
tank0206_mode_right_back
(
val
+
30
);
tank0206_mode_right_flont
(
tank0206_front_val
);
tank0206_mode_lift_flont
(
val
+
30
);
}
else
if
(
tank0206_front_t
==
2
&&
tank0206_steering_t
==
0
){
}
tank0206_mode_lift_back
(
tank0206_front_val
);
}
tank0206_mode_right_back
(
tank0206_front_val
);
if
(
modecount_tank0206
==
1
)
{
}
else
if
(
tank0206_front_t
==
0
&&
tank0206_steering_t
==
1
){
//tank0206_mode_lift_flont(val+10);
tank0206_mode_right_back
(
tank0206_steering_val
+
tank0206_count
);
if
(
tank0206_index
==
1
)
tank0206_mode_lift_back
(
0
);
tank0206_mode_lift_flont
(
tank0206_steering_val
+
tank0206_count
);
}
}
else
if
(
tank0206_front_t
==
0
&&
tank0206_steering_t
==
2
){
tank0206_mode_lift_back
(
tank0206_steering_val
+
tank0206_count
);
}
else
if
(
mode
==
4
)
{
tank0206_mode_right_flont
(
tank0206_steering_val
+
tank0206_count
);
if
(
modecount_tank0206
==
0
)
{
}
if
(
tank0206_index
==
1
)
tank0206_mode_lift_flont
(
0
);
else
if
(
tank0206_front_t
==
1
&&
tank0206_steering_t
==
1
){
else
{
tank0206_mode_lift_flont
(
tank0206_steering_val
+
tank0206_count
);
tank0206_mode_lift_back
(
val
+
30
);
tank0206_mode_right_flont
(
0
);
tank0206_mode_right_flont
(
val
+
30
);
}
else
if
(
tank0206_front_t
==
1
&&
tank0206_steering_t
==
2
){
}
tank0206_mode_lift_flont
(
0
);
//tank0206_mode_right_back(val+10);
tank0206_mode_right_flont
(
tank0206_steering_val
+
tank0206_count
);
}
}
else
if
(
tank0206_front_t
==
2
&&
tank0206_steering_t
==
1
){
if
(
modecount_tank0206
==
1
)
{
tank0206_mode_lift_back
(
tank0206_steering_val
+
tank0206_count
);
tank0206_mode_right_flont
(
0
);
tank0206_mode_right_back
(
0
);
//tank0206_mode_lift_flont(val+10);
}
else
if
(
tank0206_front_t
==
2
&&
tank0206_steering_t
==
2
){
}
tank0206_mode_lift_back
(
0
);
tank0206_mode_right_back
(
tank0206_steering_val
+
tank0206_count
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment