Skip to content
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

PWM.Period cannot be set when TimeScale is different from Seconds #79

Closed
ghost opened this issue Mar 15, 2020 · 1 comment
Closed

PWM.Period cannot be set when TimeScale is different from Seconds #79

ghost opened this issue Mar 15, 2020 · 1 comment
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Mar 15, 2020

In the following code, program seems to enter an infinite loop (or does not throw any exception) after the Console.WriteLine ("Setting Period") statement :

var pwm = Device.CreatePwmPort(Device.Pins.D04, 1000, 0.5f, false);
pwm.Start();
// Measure : 1KHz, as expected

Console.WriteLine("Setting TimeScale");
pwm.TimeScale = TimeScale.Microseconds;
Console.WriteLine("Setting Period");
pwm.Period = 50.000f;
// The following line is never reached
Console.WriteLine($" - Period : {pwm.Period}");

If you remove the pwm.TimeScale statement or set the TimeScale to Seconds (and adjust the period , e.g. 0.05 seconds), period is set correctly, giving 20 Hz for the 0.05 period.

@bryancostanich
Copy link
Contributor

fixed in b3.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants