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

HCSR-04 base code #4

Merged
merged 3 commits into from
Nov 6, 2021
Merged

HCSR-04 base code #4

merged 3 commits into from
Nov 6, 2021

Conversation

okyang
Copy link
Contributor

@okyang okyang commented Nov 5, 2021

Closes #1

@okyang okyang self-assigned this Nov 5, 2021
Copy link

@patrickanguyen patrickanguyen left a comment

Choose a reason for hiding this comment

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

Minor change, but remember to add header guards to your template_config.h

Comment on lines +50 to +51
Serial.print("Raw Distance: ");
Serial.println(distance);

Choose a reason for hiding this comment

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

Your code here is perfectly fine, but I have a minor suggestion.

ESP32 has a cool logging function called ESP_LOG. The main benefit is you can assign different log levels and they have different colors output depending on the log level.

You would have to put #include <esp_log.h> in this file and monitor_flags = --raw to your platformio.ini to see the colors if you would like to add logging feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TIL. That's awesome.

Copy link
Contributor Author

@okyang okyang Nov 6, 2021

Choose a reason for hiding this comment

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

I spent sometime trying to figure this out, but it didn't seem to work. The only output I got was

[E][main.cpp:74] setup():

I didn't see the output I wanted despite trying different logging levels. I am going to table this for now and open a new issue #5, as an enhancement because this debug output feature is already covered. Still want to figure this out eventually.

@patrickanguyen please approve the changes after reviewing again.

@@ -0,0 +1,12 @@
// ultrasonic sensor pins

Choose a reason for hiding this comment

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

Add header guards here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Header guards added, see commit 813738a.

Copy link

@patrickanguyen patrickanguyen left a comment

Choose a reason for hiding this comment

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

LGTM

@okyang okyang merged commit 07cb8eb into develop Nov 6, 2021
@okyang okyang deleted the 1-hcsr04-base-code branch November 6, 2021 05:08
okyang added a commit that referenced this pull request Dec 15, 2021
* include HCSR04 base code

* update readme

* add header guards
okyang added a commit that referenced this pull request Dec 31, 2021
* HCSR-04 base code (#4)

* include HCSR04 base code

* update readme

* add header guards

* Send Fullness Telemetry Base Code (#6)

* send fullness telemetry to Adafruit IO base code

* put the fullness code in another library

* Capture Image and Encode to Base64 string (#9)

* capture image and encode to base64 string

* refactoring Image related code

* Send image to Adafruit IO (#11)

* send base64 to adafruit IO

* use pubsub library instead and use macros toggling debugging

* fixup! use pubsub library instead and use macros toggling debugging

* Hotfixes to remove debug variable (#12)

* HCSR-04 base code (#4)

* include HCSR04 base code

* update readme

* add header guards

* Send Fullness Telemetry Base Code (#6)

* send fullness telemetry to Adafruit IO base code

* put the fullness code in another library

* Capture Image and Encode to Base64 string (#9)

* capture image and encode to base64 string

* refactoring Image related code

* Send image to Adafruit IO (#11)

* send base64 to adafruit IO

* use pubsub library instead and use macros toggling debugging

* fixup! use pubsub library instead and use macros toggling debugging

* Hotfixes to remove debug variable (#12)

* Basic CI test  (#14)

* add basic ci test

* remove extra statements

* switch back to v1

* fix name

* add a config file for ci testing

* fixup! add a config file for ci testing

* add sleep timer and adjust image quality

* add documents

* update documentation

* add contributors

* add feature photo

Co-authored-by: Primal Pappachan <primal.pappachan@gmail.com>
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.

None yet

2 participants