Skip to content

Conversation

@rtek1000
Copy link

#7

@rtek1000
Copy link
Author

If SHUTDOWN (WAKE pin) feature is not needed, the pin can be leave unconnected

#9

@rtek1000 rtek1000 changed the title Issue #7 Correction Issue #7 Correction / If SHUTDOWN (WAKE pin) feature is not needed, the pin can be leave unconnected Issue #9 Correction Feb 28, 2024
@rtek1000 rtek1000 changed the title Issue #7 Correction / If SHUTDOWN (WAKE pin) feature is not needed, the pin can be leave unconnected Issue #9 Correction Issue #7 Correction / If SHUTDOWN (WAKE pin) feature is not needed, the pin can be leave unconnected Issue #9 Feb 28, 2024
Copy link
Owner

@Skallwar Skallwar left a comment

Choose a reason for hiding this comment

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

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];
Copy link
Owner

Choose a reason for hiding this comment

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

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]);
Copy link
Owner

Choose a reason for hiding this comment

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

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];
Copy link
Owner

Choose a reason for hiding this comment

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

Same here

for (i = 0; i < 2; ++i) {
Wire.write(REG[i]);
Wire.write(DATA[i]);
delay(TIMER[i]);
Copy link
Owner

Choose a reason for hiding this comment

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

Same here, no more delay?

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);
}
Copy link
Owner

Choose a reason for hiding this comment

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

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]

Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
[Tested with ESP32 DEV KIT V1]
## Test hardware
- Arduino Mega 2560 Rev3
- ESP32 DEV KIT V1

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