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

Add pull-up resistor configuration and improve code readability #3

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

myhd
Copy link
Contributor

@myhd myhd commented Jul 25, 2024

config.h:

  • Added comments to clarify the meanings of TRIGGER_TYPE values:
    • RISING = being disconnected
    • FALLING = being connected
  • Introduced PULLUP_ENABLED macro to enable or disable the internal pull-up resistor for the input pin
  • Updated #endif with a comment for better readability

main.c:

  • Added conditional compilation block to enable the internal pull-up resistor if PULLUP_ENABLED is defined
  • Improved readability of the while loop by expanding it into multiple lines

config.h:
- Added comments to clarify the meanings of TRIGGER_TYPE values:
  - RISING = being disconnected
  - FALLING = being connected
- Introduced PULLUP_ENABLED macro to enable or disable the internal pull-up resistor for the input pin
- Updated #endif with a comment for better readability

main.c:
- Added conditional compilation block to enable the internal pull-up resistor if PULLUP_ENABLED is defined
- Improved readability of the while loop by expanding it into multiple lines
@jasonmhite
Copy link
Owner

All looks acceptable to me, thank you for your contribution!

@jasonmhite jasonmhite merged commit ddeff06 into jasonmhite:master Jul 25, 2024
@jasonmhite
Copy link
Owner

PS: @myhd what are you using this code for out of curiosity if you don't mind me asking?

@myhd
Copy link
Contributor Author

myhd commented Jul 27, 2024

PS: @myhd what are you using this code for out of curiosity if you don't mind me asking?

Happy to share: A reed switch on my letterbox flap (outside my house) is opened when mail arrives. This triggers TinyTrigger on a ATTiny, waking up an ESP8266 to connect to my apartment wifi. Using pushover.net, it sends a notification to my phone.

Using your project, the battery for the ESP lasts for months.

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