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
4557ff9f
Commit
4557ff9f
authored
Jul 31, 2025
by
957dd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加入了谁坦克的控制
parent
28919483
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
69 deletions
+77
-69
main
build/main
+0
-0
tank0206_control.c
drivers/devicecontrol/tank0206_control.c
+77
-69
No files found.
build/main
View file @
4557ff9f
No preview for this file type
drivers/devicecontrol/tank0206_control.c
View file @
4557ff9f
...
@@ -12,37 +12,37 @@ void tank0206_mode_lift_flont(unsigned char gval) {
...
@@ -12,37 +12,37 @@ void tank0206_mode_lift_flont(unsigned char gval) {
if
(
gval
<
50
)
{
if
(
gval
<
50
)
{
pwmWrite
(
PWM_PIN_SPEED
,
75
);
pwmWrite
(
PWM_PIN_SPEED
,
75
);
}
else
if
(
gval
<=
55
)
{
}
else
if
(
gval
<=
55
)
{
pwmWrite
(
PWM_PIN_SPEED
,
7
8
);
pwmWrite
(
PWM_PIN_SPEED
,
7
6
);
}
else
if
(
gval
<=
60
)
{
}
else
if
(
gval
<=
60
)
{
pwmWrite
(
PWM_PIN_SPEED
,
7
9
);
pwmWrite
(
PWM_PIN_SPEED
,
7
7
);
}
else
if
(
gval
<=
65
)
{
}
else
if
(
gval
<=
65
)
{
pwmWrite
(
PWM_PIN_SPEED
,
80
);
pwmWrite
(
PWM_PIN_SPEED
,
78
);
}
else
if
(
gval
<=
70
)
{
}
else
if
(
gval
<=
70
)
{
pwmWrite
(
PWM_PIN_SPEED
,
81
);
pwmWrite
(
PWM_PIN_SPEED
,
79
);
}
else
if
(
gval
<=
75
)
{
}
else
if
(
gval
<=
75
)
{
pwmWrite
(
PWM_PIN_SPEED
,
8
2
);
pwmWrite
(
PWM_PIN_SPEED
,
8
0
);
}
else
if
(
gval
<=
90
)
{
}
else
if
(
gval
<=
90
)
{
pwmWrite
(
PWM_PIN_SPEED
,
8
3
);
pwmWrite
(
PWM_PIN_SPEED
,
8
1
);
}
else
if
(
gval
<=
100
)
{
}
else
if
(
gval
<=
100
)
{
pwmWrite
(
PWM_PIN_SPEED
,
8
4
);
pwmWrite
(
PWM_PIN_SPEED
,
8
2
);
}
else
if
(
gval
<=
110
)
{
}
else
if
(
gval
<=
110
)
{
pwmWrite
(
PWM_PIN_SPEED
,
8
5
);
pwmWrite
(
PWM_PIN_SPEED
,
8
3
);
}
else
if
(
gval
<=
120
)
{
}
else
if
(
gval
<=
120
)
{
pwmWrite
(
PWM_PIN_SPEED
,
8
6
);
pwmWrite
(
PWM_PIN_SPEED
,
8
4
);
}
else
if
(
gval
<=
130
)
{
}
else
if
(
gval
<=
130
)
{
pwmWrite
(
PWM_PIN_SPEED
,
8
7
);
pwmWrite
(
PWM_PIN_SPEED
,
8
5
);
}
else
if
(
gval
<=
140
)
{
}
else
if
(
gval
<=
140
)
{
pwmWrite
(
PWM_PIN_SPEED
,
8
8
);
pwmWrite
(
PWM_PIN_SPEED
,
8
6
);
}
else
if
(
gval
<=
150
)
{
}
else
if
(
gval
<=
150
)
{
pwmWrite
(
PWM_PIN_SPEED
,
8
9
);
pwmWrite
(
PWM_PIN_SPEED
,
8
7
);
}
else
if
(
gval
<=
160
)
{
}
else
if
(
gval
<=
160
)
{
pwmWrite
(
PWM_PIN_SPEED
,
90
);
pwmWrite
(
PWM_PIN_SPEED
,
88
);
}
else
if
(
gval
<=
170
)
{
}
else
if
(
gval
<=
170
)
{
pwmWrite
(
PWM_PIN_SPEED
,
91
);
pwmWrite
(
PWM_PIN_SPEED
,
89
);
}
else
if
(
gval
<=
180
)
{
}
else
if
(
gval
<=
180
)
{
pwmWrite
(
PWM_PIN_SPEED
,
9
2
);
pwmWrite
(
PWM_PIN_SPEED
,
9
0
);
}
else
if
(
gval
<=
190
)
{
}
else
if
(
gval
<=
190
)
{
pwmWrite
(
PWM_PIN_SPEED
,
9
3
);
pwmWrite
(
PWM_PIN_SPEED
,
9
1
);
}
else
if
(
gval
<=
200
)
{
}
else
if
(
gval
<=
200
)
{
pwmWrite
(
PWM_PIN_SPEED
,
94
);
pwmWrite
(
PWM_PIN_SPEED
,
94
);
}
}
...
@@ -52,37 +52,37 @@ void tank0206_mode_lift_back(unsigned char gval) {
...
@@ -52,37 +52,37 @@ void tank0206_mode_lift_back(unsigned char gval) {
if
(
gval
<
50
)
{
if
(
gval
<
50
)
{
pwmWrite
(
PWM_PIN_SPEED
,
75
);
pwmWrite
(
PWM_PIN_SPEED
,
75
);
}
else
if
(
gval
<=
55
)
{
}
else
if
(
gval
<=
55
)
{
pwmWrite
(
PWM_PIN_SPEED
,
7
2
);
pwmWrite
(
PWM_PIN_SPEED
,
7
4
);
}
else
if
(
gval
<=
60
)
{
}
else
if
(
gval
<=
60
)
{
pwmWrite
(
PWM_PIN_SPEED
,
7
1
);
pwmWrite
(
PWM_PIN_SPEED
,
7
3
);
}
else
if
(
gval
<=
65
)
{
}
else
if
(
gval
<=
65
)
{
pwmWrite
(
PWM_PIN_SPEED
,
7
0
);
pwmWrite
(
PWM_PIN_SPEED
,
7
2
);
}
else
if
(
gval
<=
70
)
{
}
else
if
(
gval
<=
70
)
{
pwmWrite
(
PWM_PIN_SPEED
,
69
);
pwmWrite
(
PWM_PIN_SPEED
,
71
);
}
else
if
(
gval
<=
75
)
{
}
else
if
(
gval
<=
75
)
{
pwmWrite
(
PWM_PIN_SPEED
,
68
);
pwmWrite
(
PWM_PIN_SPEED
,
70
);
}
else
if
(
gval
<=
90
)
{
}
else
if
(
gval
<=
90
)
{
pwmWrite
(
PWM_PIN_SPEED
,
6
7
);
pwmWrite
(
PWM_PIN_SPEED
,
6
9
);
}
else
if
(
gval
<=
100
)
{
}
else
if
(
gval
<=
100
)
{
pwmWrite
(
PWM_PIN_SPEED
,
6
6
);
pwmWrite
(
PWM_PIN_SPEED
,
6
8
);
}
else
if
(
gval
<=
110
)
{
}
else
if
(
gval
<=
110
)
{
pwmWrite
(
PWM_PIN_SPEED
,
6
5
);
pwmWrite
(
PWM_PIN_SPEED
,
6
7
);
}
else
if
(
gval
<=
120
)
{
}
else
if
(
gval
<=
120
)
{
pwmWrite
(
PWM_PIN_SPEED
,
6
4
);
pwmWrite
(
PWM_PIN_SPEED
,
6
6
);
}
else
if
(
gval
<=
130
)
{
}
else
if
(
gval
<=
130
)
{
pwmWrite
(
PWM_PIN_SPEED
,
6
3
);
pwmWrite
(
PWM_PIN_SPEED
,
6
5
);
}
else
if
(
gval
<=
140
)
{
}
else
if
(
gval
<=
140
)
{
pwmWrite
(
PWM_PIN_SPEED
,
6
2
);
pwmWrite
(
PWM_PIN_SPEED
,
6
4
);
}
else
if
(
gval
<=
150
)
{
}
else
if
(
gval
<=
150
)
{
pwmWrite
(
PWM_PIN_SPEED
,
6
1
);
pwmWrite
(
PWM_PIN_SPEED
,
6
3
);
}
else
if
(
gval
<=
160
)
{
}
else
if
(
gval
<=
160
)
{
pwmWrite
(
PWM_PIN_SPEED
,
6
0
);
pwmWrite
(
PWM_PIN_SPEED
,
6
2
);
}
else
if
(
gval
<=
170
)
{
}
else
if
(
gval
<=
170
)
{
pwmWrite
(
PWM_PIN_SPEED
,
59
);
pwmWrite
(
PWM_PIN_SPEED
,
61
);
}
else
if
(
gval
<=
180
)
{
}
else
if
(
gval
<=
180
)
{
pwmWrite
(
PWM_PIN_SPEED
,
58
);
pwmWrite
(
PWM_PIN_SPEED
,
60
);
}
else
if
(
gval
<=
190
)
{
}
else
if
(
gval
<=
190
)
{
pwmWrite
(
PWM_PIN_SPEED
,
5
7
);
pwmWrite
(
PWM_PIN_SPEED
,
5
9
);
}
else
if
(
gval
<=
200
)
{
}
else
if
(
gval
<=
200
)
{
pwmWrite
(
PWM_PIN_SPEED
,
56
);
pwmWrite
(
PWM_PIN_SPEED
,
56
);
}
}
...
@@ -92,37 +92,37 @@ void tank0206_mode_right_flont(unsigned char gval) {
...
@@ -92,37 +92,37 @@ void tank0206_mode_right_flont(unsigned char gval) {
if
(
gval
<
50
)
{
if
(
gval
<
50
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
75
);
pwmWrite
(
PWM_PIN_CHANGE
,
75
);
}
else
if
(
gval
<=
55
)
{
}
else
if
(
gval
<=
55
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
7
8
);
pwmWrite
(
PWM_PIN_CHANGE
,
7
6
);
}
else
if
(
gval
<=
60
)
{
}
else
if
(
gval
<=
60
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
7
9
);
pwmWrite
(
PWM_PIN_CHANGE
,
7
7
);
}
else
if
(
gval
<=
65
)
{
}
else
if
(
gval
<=
65
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
80
);
pwmWrite
(
PWM_PIN_CHANGE
,
78
);
}
else
if
(
gval
<=
70
)
{
}
else
if
(
gval
<=
70
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
81
);
pwmWrite
(
PWM_PIN_CHANGE
,
79
);
}
else
if
(
gval
<=
75
)
{
}
else
if
(
gval
<=
75
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
8
2
);
pwmWrite
(
PWM_PIN_CHANGE
,
8
0
);
}
else
if
(
gval
<=
90
)
{
}
else
if
(
gval
<=
90
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
8
3
);
pwmWrite
(
PWM_PIN_CHANGE
,
8
1
);
}
else
if
(
gval
<=
100
)
{
}
else
if
(
gval
<=
100
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
8
4
);
pwmWrite
(
PWM_PIN_CHANGE
,
8
2
);
}
else
if
(
gval
<=
110
)
{
}
else
if
(
gval
<=
110
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
8
5
);
pwmWrite
(
PWM_PIN_CHANGE
,
8
3
);
}
else
if
(
gval
<=
120
)
{
}
else
if
(
gval
<=
120
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
8
6
);
pwmWrite
(
PWM_PIN_CHANGE
,
8
4
);
}
else
if
(
gval
<=
130
)
{
}
else
if
(
gval
<=
130
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
8
7
);
pwmWrite
(
PWM_PIN_CHANGE
,
8
5
);
}
else
if
(
gval
<=
140
)
{
}
else
if
(
gval
<=
140
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
8
8
);
pwmWrite
(
PWM_PIN_CHANGE
,
8
6
);
}
else
if
(
gval
<=
150
)
{
}
else
if
(
gval
<=
150
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
8
9
);
pwmWrite
(
PWM_PIN_CHANGE
,
8
7
);
}
else
if
(
gval
<=
160
)
{
}
else
if
(
gval
<=
160
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
90
);
pwmWrite
(
PWM_PIN_CHANGE
,
88
);
}
else
if
(
gval
<=
170
)
{
}
else
if
(
gval
<=
170
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
91
);
pwmWrite
(
PWM_PIN_CHANGE
,
89
);
}
else
if
(
gval
<=
180
)
{
}
else
if
(
gval
<=
180
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
9
2
);
pwmWrite
(
PWM_PIN_CHANGE
,
9
0
);
}
else
if
(
gval
<=
190
)
{
}
else
if
(
gval
<=
190
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
9
3
);
pwmWrite
(
PWM_PIN_CHANGE
,
9
1
);
}
else
if
(
gval
<=
200
)
{
}
else
if
(
gval
<=
200
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
94
);
pwmWrite
(
PWM_PIN_CHANGE
,
94
);
}
}
...
@@ -132,37 +132,37 @@ void tank0206_mode_right_back(unsigned char gval) {
...
@@ -132,37 +132,37 @@ void tank0206_mode_right_back(unsigned char gval) {
if
(
gval
<
50
)
{
if
(
gval
<
50
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
75
);
pwmWrite
(
PWM_PIN_CHANGE
,
75
);
}
else
if
(
gval
<=
55
)
{
}
else
if
(
gval
<=
55
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
7
1
);
pwmWrite
(
PWM_PIN_CHANGE
,
7
4
);
}
else
if
(
gval
<=
60
)
{
}
else
if
(
gval
<=
60
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
7
0
);
pwmWrite
(
PWM_PIN_CHANGE
,
7
3
);
}
else
if
(
gval
<=
65
)
{
}
else
if
(
gval
<=
65
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
7
0
);
pwmWrite
(
PWM_PIN_CHANGE
,
7
2
);
}
else
if
(
gval
<=
70
)
{
}
else
if
(
gval
<=
70
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
7
0
);
pwmWrite
(
PWM_PIN_CHANGE
,
7
1
);
}
else
if
(
gval
<=
75
)
{
}
else
if
(
gval
<=
75
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
69
);
pwmWrite
(
PWM_PIN_CHANGE
,
70
);
}
else
if
(
gval
<=
90
)
{
}
else
if
(
gval
<=
90
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
6
8
);
pwmWrite
(
PWM_PIN_CHANGE
,
6
9
);
}
else
if
(
gval
<=
100
)
{
}
else
if
(
gval
<=
100
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
68
);
pwmWrite
(
PWM_PIN_CHANGE
,
68
);
}
else
if
(
gval
<=
110
)
{
}
else
if
(
gval
<=
110
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
6
6
);
pwmWrite
(
PWM_PIN_CHANGE
,
6
7
);
}
else
if
(
gval
<=
120
)
{
}
else
if
(
gval
<=
120
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
6
5
);
pwmWrite
(
PWM_PIN_CHANGE
,
6
6
);
}
else
if
(
gval
<=
130
)
{
}
else
if
(
gval
<=
130
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
6
4
);
pwmWrite
(
PWM_PIN_CHANGE
,
6
5
);
}
else
if
(
gval
<=
140
)
{
}
else
if
(
gval
<=
140
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
6
2
);
pwmWrite
(
PWM_PIN_CHANGE
,
6
4
);
}
else
if
(
gval
<=
150
)
{
}
else
if
(
gval
<=
150
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
6
0
);
pwmWrite
(
PWM_PIN_CHANGE
,
6
3
);
}
else
if
(
gval
<=
160
)
{
}
else
if
(
gval
<=
160
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
59
);
pwmWrite
(
PWM_PIN_CHANGE
,
62
);
}
else
if
(
gval
<=
170
)
{
}
else
if
(
gval
<=
170
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
58
);
pwmWrite
(
PWM_PIN_CHANGE
,
61
);
}
else
if
(
gval
<=
180
)
{
}
else
if
(
gval
<=
180
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
57
);
pwmWrite
(
PWM_PIN_CHANGE
,
60
);
}
else
if
(
gval
<=
190
)
{
}
else
if
(
gval
<=
190
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
5
6
);
pwmWrite
(
PWM_PIN_CHANGE
,
5
9
);
}
else
if
(
gval
<=
200
)
{
}
else
if
(
gval
<=
200
)
{
pwmWrite
(
PWM_PIN_CHANGE
,
55
);
pwmWrite
(
PWM_PIN_CHANGE
,
55
);
}
}
...
@@ -171,22 +171,30 @@ void tank0206_mode_right_back(unsigned char gval) {
...
@@ -171,22 +171,30 @@ void tank0206_mode_right_back(unsigned char gval) {
void
tank0206_change
(
unsigned
char
*
buf
)
{
void
tank0206_change
(
unsigned
char
*
buf
)
{
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
;
if
(
mode
==
1
)
{
if
(
mode
==
1
)
{
tank0206
_mode_lift_flont
(
val
);
//tank0203
_mode_lift_flont(val);
tank0206_mode_right_flont
(
val
);
tank0206_mode_right_flont
(
val
);
modecount_tank0206
=
0
;
}
else
if
(
mode
==
2
)
{
}
else
if
(
mode
==
2
)
{
tank0206
_mode_lift_back
(
val
);
//tank0203
_mode_lift_back(val);
tank0206_mode_right_back
(
val
);
tank0206_mode_right_back
(
val
);
modecount_tank0206
=
1
;
}
}
if
((
mode
==
1
||
mode
==
2
)
&&
val
==
0
)
modecount_tank0206
=
0
;
if
(
mode
==
3
)
{
if
(
mode
==
3
)
{
//tank0206_mode_lift_flont(val);
if
(
modecount_tank0206
==
0
)
tank0206_mode_lift_flont
(
val
+
10
);
tank0206_mode_lift_back
(
val
);
if
(
modecount_tank0206
==
1
)
tank0206_mode_lift_back
(
val
+
10
);
}
else
if
(
mode
==
4
)
{
}
else
if
(
mode
==
4
)
{
//tank0206_mode_lift_back(val
);
if
(
modecount_tank0206
==
0
)
tank0206_mode_lift_back
(
val
+
10
);
tank0206_mode_right_flont
(
val
);
if
(
modecount_tank0206
==
1
)
tank0206_mode_lift_flont
(
val
+
10
);
}
}
}
}
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