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 PWM #86

Merged
merged 5 commits into from
Nov 27, 2024
Merged

Fix PWM #86

merged 5 commits into from
Nov 27, 2024

Conversation

patrickelectric
Copy link
Member

No description provided.

Signed-off-by: Patrick José Pereira <[email protected]>
Signed-off-by: Patrick José Pereira <[email protected]>
pin.set_direction(Direction::Low)?;
pin.set_direction(Direction::High)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering what a low/high direction even means, here it is:

"direction" ... reads as either "in" or "out". This value may
normally be written. Writing as "out" defaults to
initializing the value as low. To ensure glitch free
operation, values "low" and "high" may be written to
configure the GPIO as an output with that initial value.

reference

So here we are configuring the pin to be an output with the initial state as high.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cargo.toml Outdated Show resolved Hide resolved
src/pca9685.rs Show resolved Hide resolved
@patrickelectric patrickelectric force-pushed the fix-pwm branch 2 times, most recently from 530ab88 to eb01016 Compare November 27, 2024 15:05
src/bmp280.rs Outdated Show resolved Hide resolved
@patrickelectric patrickelectric merged commit 0e90ec0 into bluerobotics:master Nov 27, 2024
6 checks passed
@patrickelectric patrickelectric deleted the fix-pwm branch November 27, 2024 17:33
let mut imu = Icm20689Device::builder().build().unwrap();
let mut imu = Icm20689Device::builder()
.build()
.expect("Failed to build ICM20689: {error:?}");
Copy link
Member

@joaoantoniocardoso joaoantoniocardoso Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, this should be fixed to "Failed to build ICM20689", as this is not a formatted string, same for the others. The error message is automatically shown by the underlying unwrap mechanism.

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.

3 participants