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
a2419b28
Commit
a2419b28
authored
Jul 25, 2025
by
学习的菜鸟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加入了0202,0203坦克
parent
6f296a91
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
main
build/main
+0
-0
tank0202_control.c
drivers/devicecontrol/tank0202_control.c
+4
-4
tank_common.c
drivers/devicecontrol/tank_common.c
+4
-4
gpio_init.c
drivers/gpio/gpio_init.c
+2
-2
No files found.
build/main
View file @
a2419b28
No preview for this file type
drivers/devicecontrol/tank0202_control.c
View file @
a2419b28
...
...
@@ -186,11 +186,11 @@ void tank0202_change(unsigned char *buf) {
if
((
mode
==
1
||
mode
==
2
)
&&
val
==
0
)
g_modecount_tank0202
=
0
;
if
(
mode
==
3
)
{
if
(
g_modecount_tank0202
==
0
)
mode_lift_back
(
val
+
2
5
);
if
(
g_modecount_tank0202
==
1
)
mode_lift_flont
(
val
+
2
5
);
if
(
g_modecount_tank0202
==
0
)
mode_lift_back
(
val
+
2
0
);
if
(
g_modecount_tank0202
==
1
)
mode_lift_flont
(
val
+
2
0
);
}
else
if
(
mode
==
4
)
{
if
(
g_modecount_tank0202
==
0
)
mode_lift_flont
(
val
+
2
5
);
if
(
g_modecount_tank0202
==
1
)
mode_lift_back
(
val
+
2
5
);
if
(
g_modecount_tank0202
==
0
)
mode_lift_flont
(
val
+
2
0
);
if
(
g_modecount_tank0202
==
1
)
mode_lift_back
(
val
+
2
0
);
}
}
drivers/devicecontrol/tank_common.c
View file @
a2419b28
...
...
@@ -54,16 +54,16 @@ void tank_shot_back(unsigned char gval) {
const
tank_common_back
tank_common_config_t
[]
=
{
{
.
device_id
=
DEVICE_TANK0202
,
.
back_time
=
1
0
,
//后退多少ms
.
back_interval_back
=
1
00
,
//间隔多少ms才能再次使用
.
back_time
=
1
5
,
//后退多少ms
.
back_interval_back
=
2
00
,
//间隔多少ms才能再次使用
.
shot_back_speed
=
80
,
.
shot_back
=
tank_shot_back_stop
},
{
.
device_id
=
DEVICE_TANK0203
,
.
back_time
=
1
0
,
//后退多少ms
.
back_interval_back
=
1
00
,
//间隔多少ms才能再次使用
.
back_time
=
1
5
,
//后退多少ms
.
back_interval_back
=
2
00
,
//间隔多少ms才能再次使用
.
shot_back_speed
=
80
,
.
shot_back
=
tank_shot_back_stop
},
...
...
drivers/gpio/gpio_init.c
View file @
a2419b28
...
...
@@ -74,8 +74,8 @@ void pwm_value(int pin,int value) { //软件陪我们控制调速
my_zlog_debug
(
"pin:%d,%d"
,
pin
,
shot_speed
);
}
}
else
{
if
(
g_device_type
==
DEVICE_TANK0202
)
softPwmWrite
(
pin
,
3
0
);
if
(
g_device_type
==
DEVICE_TANK0203
)
softPwmWrite
(
pin
,
3
0
);
if
(
g_device_type
==
DEVICE_TANK0202
)
softPwmWrite
(
pin
,
3
5
);
if
(
g_device_type
==
DEVICE_TANK0203
)
softPwmWrite
(
pin
,
3
5
);
else
{
softPwmWrite
(
pin
,
shot_speed
);
}
...
...
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