Issue #7 Correction / If SHUTDOWN (WAKE pin) feature is not needed, the pin can be leave unconnected Issue #9#8
Open
rtek1000 wants to merge 12 commits into
Open
Issue #7 Correction / If SHUTDOWN (WAKE pin) feature is not needed, the pin can be leave unconnected Issue #9#8rtek1000 wants to merge 12 commits into
rtek1000 wants to merge 12 commits into
Conversation
Author
|
If SHUTDOWN (WAKE pin) feature is not needed, the pin can be leave unconnected |
Skallwar
reviewed
Feb 29, 2024
Skallwar
left a comment
Owner
There was a problem hiding this comment.
Thanks for you PR 🔥
I can't test it currently so I trust you on this :D
I will try to make a release out of it and if it break something for someone, the old version will still be there just in case
| uint8_t TIMER[4] = {20, 5, 5, 20}; | ||
|
|
||
| Wire.beginTransmission(I2CADDR); | ||
| uint8_t _data[1]; |
Owner
There was a problem hiding this comment.
Instead of an array of 1, just make it an uint8_t
| for (i = 0; i < 4; ++i) { | ||
| Wire.write(REG[i]); | ||
| Wire.write(DATA[i]); | ||
| delay(TIMER[i]); |
Owner
There was a problem hiding this comment.
No need for a delay here? I don't have the hardware anymore but I remember spending a lot of time figuring out the timings, it wouldn't work otherwise
| uint8_t TIMER[2] = {20, 10}; | ||
|
|
||
| Wire.beginTransmission(I2CADDR); | ||
| uint8_t _data[1]; |
| for (i = 0; i < 2; ++i) { | ||
| Wire.write(REG[i]); | ||
| Wire.write(DATA[i]); | ||
| delay(TIMER[i]); |
Comment on lines
+189
to
+196
| if(n == 5) { | ||
| SERIAL_ERROR.println("i2c write error: timeout"); | ||
| } else { | ||
| SERIAL_ERROR.print("i2c write error: "); | ||
| SERIAL_ERROR.print(n); | ||
| SERIAL_ERROR.print(" "); | ||
| SERIAL_ERROR.println(DATA_REG, HEX); | ||
| } |
Owner
There was a problem hiding this comment.
This block of code is in 2 places, could you make a function out of it?
Comment on lines
+16
to
+17
| [Tested with ESP32 DEV KIT V1] | ||
|
|
Owner
There was a problem hiding this comment.
Suggested change
| [Tested with ESP32 DEV KIT V1] | |
| ## Test hardware | |
| - Arduino Mega 2560 Rev3 | |
| - ESP32 DEV KIT V1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#7