Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Philip A Levis
EE185
Commits
61da345e
Commit
61da345e
authored
Oct 24, 2021
by
Alex Wang Fu
Browse files
pwwm wworks. just wasnt using large enough duty cycle
parent
b96a7ed5
Changes
2
Hide whitespace changes
Inline
Side-by-side
software/firmware/circuitpython-main/ports/atmel-samd/common-hal/motor_control/PWM.c
View file @
61da345e
...
@@ -52,6 +52,7 @@ void set_pwm(bool left, bool up, float fduty) {
...
@@ -52,6 +52,7 @@ void set_pwm(bool left, bool up, float fduty) {
MOTOR_PWM_FREQUENCY
,
false
);
MOTOR_PWM_FREQUENCY
,
false
);
common_hal_pwmio_pwmout_construct
(
&
right_backward_wing
,
right_backward_pin
,
common_hal_pwmio_pwmout_construct
(
&
right_backward_wing
,
right_backward_pin
,
0
,
MOTOR_PWM_FREQUENCY
,
false
);
0
,
MOTOR_PWM_FREQUENCY
,
false
);
initted
=
true
;
}
}
// Convert from the float to a fraction of 65536
// Convert from the float to a fraction of 65536
...
...
software/firmware/circuitpython-main/shared-module/ee285/__init__.c
View file @
61da345e
...
@@ -189,19 +189,19 @@ void shared_module_ee285_test(void)
...
@@ -189,19 +189,19 @@ void shared_module_ee285_test(void)
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
//! Issue: none of the upward movements work!
//! Issue: none of the upward movements work!
set_pwm
(
LEFT
,
UP
,
.
25
);
set_pwm
(
LEFT
,
UP
,
MAX_DUTY
);
common_hal_time_delay_ms
(
1000
);
common_hal_time_delay_ms
(
1000
);
set_pwm
(
LEFT
,
UP
,
0
.
0
);
set_pwm
(
LEFT
,
UP
,
0
.
0
);
set_pwm
(
LEFT
,
DOWN
,
.
25
);
set_pwm
(
LEFT
,
DOWN
,
MAX_DUTY
);
common_hal_time_delay_ms
(
1000
);
common_hal_time_delay_ms
(
1000
);
set_pwm
(
LEFT
,
DOWN
,
0
.
0
);
set_pwm
(
LEFT
,
DOWN
,
0
.
0
);
set_pwm
(
RIGHT
,
UP
,
.
25
);
set_pwm
(
RIGHT
,
UP
,
MAX_DUTY
);
common_hal_time_delay_ms
(
1000
);
common_hal_time_delay_ms
(
1000
);
set_pwm
(
RIGHT
,
UP
,
0
.
0
);
set_pwm
(
RIGHT
,
UP
,
0
.
0
);
set_pwm
(
RIGHT
,
DOWN
,
.
25
);
set_pwm
(
RIGHT
,
DOWN
,
MAX_DUTY
);
common_hal_time_delay_ms
(
1000
);
common_hal_time_delay_ms
(
1000
);
set_pwm
(
RIGHT
,
DOWN
,
0
.
0
);
set_pwm
(
RIGHT
,
DOWN
,
0
.
0
);
}
}
...
...
Write
Preview
Supports
Markdown
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