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

drivers: sensor: hc-sr04: add driver #76285

Merged
merged 2 commits into from
Nov 16, 2024

Conversation

Pixep
Copy link
Contributor

@Pixep Pixep commented Jul 25, 2024

Add a simple driver for the HC-SR04 ultrasonic distance sensor. This sensor only uses two GPIO pins (trigger and echo) to trigger the acquisition. The signal received on the echo pin is the duration between the emission of the ultrasonic pulse and the feedback received (within range of the sensor).

Copy link
Member

@MaureenHelm MaureenHelm left a comment

Choose a reason for hiding this comment

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

Add this sensor to tests/drivers/build_all/sensor

drivers/sensor/hc_sr04/hc_sr04.c Outdated Show resolved Hide resolved
drivers/sensor/hc_sr04/hc_sr04.h Outdated Show resolved Hide resolved
Add a simple driver for the HC-SR04 ultrasonic distance sensor.

Signed-off-by: Adrien Leravat <[email protected]>
@Pixep Pixep force-pushed the sensor/hcsr04 branch 2 times, most recently from b04ce99 to de9c280 Compare July 28, 2024 02:16
@Pixep
Copy link
Contributor Author

Pixep commented Jul 28, 2024

Add this sensor to tests/drivers/build_all/sensor

Done. Let me know if you see any improvements to make!

@Pixep Pixep force-pushed the sensor/hcsr04 branch 4 times, most recently from 7c1c57f to dec2c8f Compare July 28, 2024 16:25
@Pixep Pixep requested a review from MaureenHelm July 28, 2024 16:28
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Sep 27, 2024
@Pixep
Copy link
Contributor Author

Pixep commented Sep 27, 2024

Hi, this is still active, and the requested changes have been made.
Happy to rebase if needed.

@github-actions github-actions bot removed the Stale label Sep 28, 2024
@Pixep
Copy link
Contributor Author

Pixep commented Oct 14, 2024

Hi @MaureenHelm , when you have time, would you be able to take a look and let me know if the update is going in the right direction?
I would be happy to rebase and update it further, as long as this driver is of interest to Zephyr.

Thank you!

Add automated build and functional tests for the HC-SR04.

Signed-off-by: Adrien Leravat <[email protected]>
@Pixep
Copy link
Contributor Author

Pixep commented Oct 23, 2024

Thank you @ubieda, I missed the distinction between build and functional tests.
Updated the PR to add the build test.

@Pixep Pixep requested a review from ubieda November 11, 2024 19:37
@nashif nashif merged commit 1d6a89d into zephyrproject-rtos:main Nov 16, 2024
25 checks passed
@Pixep Pixep deleted the sensor/hcsr04 branch November 16, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants