-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing PWM Frequency does not seem to work #302
Comments
Ok, it seems I was mistaken. Sorry about that. After measuring the signal with an oscilloscope, I confirmed the frequency was as intended, but the output voltage at max was only 3.3v, which confused me before. |
Hi @LordSyd I'm sorry about the delayed response on this issue. Thanks! |
Hi,
I need to change the PWM frequency the board provides to 5000 Hz for my project. I tried using the code sample provided here:
#57
This snippet to be precise:
`#define PWM_PIN_MAX 6
int pwm_pins[PWM_PIN_MAX] = { 3, 5, 6, 9, 10, 11 };
byte i;
void setup() {
for(i = 0; i < PWM_PIN_MAX; i++)
{
drv_pwm_set_freq(pwm_pins[i], 1000000); // It is constrained to frequencies from 1Hz to 1MHz.
drv_pwm_setup(pwm_pins[i]);
}
}
void loop() {
for(i = 0; i < PWM_PIN_MAX; i++)
{
drv_pwm_set_duty(pwm_pins[i], 8, 255); //100% duty cycle
}
delay(100);
}`
But this did not work as expected. I measured the voltage using a multimeter and got around 3,3v, which seems odd. I was hoping, as these are Arduino pins, for the upper bound to be 5v, or am I mistaken?
Regards, Daniel
The text was updated successfully, but these errors were encountered: