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

Fix speed calculation in SwitchingAnemometer #1123

Merged

Conversation

doingnz
Copy link
Contributor

@doingnz doingnz commented Feb 14, 2025

Driver
Use the Delta property of the observed DigitalPortResult to determine interval from one edge to the next.
Ignore impossibly high speeds set by new property MaxSpeed, defaults to 500 km/hr.
Minor code refactor to make code execution clearer that speed returned is zero if to much time between samples, to few samples, or speed is too high.
Add clarification to some comments

Sample
Added commented code for testing the SwitchingAnemometer by driving the input from a PWM port running at set frequency.

Use the DigitalPortResult.Delta property to determin duration of change from one edge to the next. Ignore impossibly high speeds (> 500 km/hr)
@ctacke ctacke merged commit 42a8b64 into WildernessLabs:develop Feb 14, 2025
1 check passed
@doingnz doingnz deleted the bug-SwitchingAnemometer-Speed branch February 15, 2025 00:30
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

Successfully merging this pull request may close these issues.

2 participants