-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
There was a problem hiding this 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
Serial.print("Raw Distance: "); | ||
Serial.println(distance); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL. That's awesome.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add header guards here
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* include HCSR04 base code * update readme * add header guards
* 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>
Closes #1