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
b0bd60e0
Commit
b0bd60e0
authored
Mar 17, 2025
by
957dd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新了坦克代码占用pwm引脚的问题
parent
2b8c9f58
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
8 deletions
+13
-8
main
main
+0
-0
gpio_pwm.c
src/gpio_pwm.c
+13
-6
gpio_pwm.o
src/gpio_pwm.o
+0
-0
mqtt.c
src/mqtt.c
+0
-2
mqtt.o
src/mqtt.o
+0
-0
No files found.
main
View file @
b0bd60e0
No preview for this file type
src/gpio_pwm.c
View file @
b0bd60e0
...
...
@@ -35,15 +35,22 @@ void pin_all_default()//全部至低电平
void
pin_value
(
int
pin
,
int
value
)
{
if
(
value
==
1
)
{
digitalWrite
(
pin
,
HIGH
);
if
(
pin
==
2
){
pinMode
(
pin
,
OUTPUT
);
}
if
(
pin
==
21
){
pinMode
(
pin
,
OUTPUT
);
}
else
if
(
value
==
0
)
{
if
(
value
==
1
){
digitalWrite
(
pin
,
HIGH
);
printf
(
"pin:%d,%d
\n
"
,
pin
,
HIGH
);
}
else
if
(
value
==
0
){
digitalWrite
(
pin
,
LOW
);
printf
(
"pin:%d,%d
\n
"
,
pin
,
LOW
);
}
printf
(
"pin:%d,%d
\n
"
,
pin
,
value
);
}
void
pwm_speed
()
{
...
...
src/gpio_pwm.o
100755 → 100644
View file @
b0bd60e0
No preview for this file type
src/mqtt.c
View file @
b0bd60e0
...
...
@@ -118,8 +118,6 @@ void message_3(cJSON *body,cJSON *pwm_ctrl)//message_type为3,控制pwm
void
message_4
(
cJSON
*
body
,
cJSON
*
pin_setctrl
)
//message 为4时候
{
cJSON
*
pin
=
cJSON_GetObjectItem
(
pin_setctrl
,
"pin"
);
cJSON
*
val
=
cJSON_GetObjectItem
(
pin_setctrl
,
"val"
);
//val为pwm的值 0~100(unsigned char)(unsigned char)
pinTemp
=
pin
->
valueint
;
...
...
src/mqtt.o
View file @
b0bd60e0
No preview for this file type
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