Added RAM access functions, removed overloaded begin() function #6
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.
Bug fix: The Wire.h in the ESP32 library has the ability to set the SDA and SCL pins, but the Arduino Wire.h does not. Anyone trying to use this on an Arduino will get the "no matching function for call to 'TwoWire::begin..." as mentioned in the one issue on this library. I've removed that function so that it will compile properly on Arduino/AVR chips as well as ESP32. When the Arduino library is updated we can replace this function (which is super cool).
Feature add: I've added functions to read and write to RAM. The functions are fairly intuitive, I think.
void getRam() reads the contents of the DS1307 chip into a variable called "ram" which is publicly accessible.
void setRam() writes the contents of "ram" to the DS1307 chip.
If you only need to read/write an address, you can individually set each address to a specific 8 bit value (this saves time over reading/writing the entire ram buffer):
void setRamAddress(uint8_t _addr, uint8_t _value) sets a specific address (_addr) to a value (_value). It also updates the ram buffer.
uint8_t getRamAddress(uint8_t _addr) returns the value at a specific address (_addr)
RAM addresses are 0 indexed.