Last active
September 29, 2016 17:21
-
-
Save nseidle/e0ead19c893121b60157652ecc6c3f46 to your computer and use it in GitHub Desktop.
This file contains 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
//Initialize the I2C port | |
bool Memory::begin(TwoWire &wirePort) | |
{ | |
_i2cPort = &wirePort; //Grab which port the user wants us to use | |
_i2cPort->begin(); | |
} | |
//Store a piece of data (thing) into a given address (place) | |
void Memory::writeValue(uint16_t place, uint8_t thing) | |
{ | |
_i2cPort->beginTransmission((uint8_t)EEPROM_ADDRESS); | |
_i2cPort->write(place >> 8); | |
_i2cPort->write(place & 0xFF); | |
_i2cPort->write(thing); | |
_i2cPort->endTransmission(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment