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
909de3fe
Commit
909de3fe
authored
Feb 11, 2025
by
957dd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pin
parent
4dcfc199
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
gpio_pwm.c
src/gpio_pwm.c
+6
-0
No files found.
src/gpio_pwm.c
View file @
909de3fe
...
...
@@ -12,6 +12,8 @@
// 定义占空比范围,这里设置为 0 到 1000
#define MAX_DUTY 1000
void
pwm_speed
()
{
int
pwm_clock
=
19200000
/
(
PWM_FREQ
*
1000
);
...
...
@@ -37,6 +39,8 @@ void midde_pwm()
void
mode_1_flont
(
unsigned
char
gval
)
{
digitalWrite
(
SPEED_IN_1
,
HIGH
);
digitalWrite
(
SPEED_IN_2
,
LOW
);
if
(
gval
<=
50
)
{
pwmWrite
(
PWM_PIN_SPEED
,
150
);
...
...
@@ -74,6 +78,8 @@ void mode_1_flont(unsigned char gval)
void
mode_2_back
(
unsigned
char
gval
)
{
digitalWrite
(
SPEED_IN_2
,
HIGH
);
digitalWrite
(
SPEED_IN_1
,
LOW
);
if
(
gval
<=
50
)
{
pwmWrite
(
PWM_PIN_SPEED
,
150
);
...
...
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