Last active
August 29, 2015 14:05
-
-
Save mroger/46804aa3053a62ba9d21 to your computer and use it in GitHub Desktop.
Shows how to update transmission data after status bytes are read in reception_data
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
void TEA5767N::loadFrequency() { | |
readStatus(); | |
transmission_data[FIRST_DATA] = (transmission_data[FIRST_DATA] & 0xC0) | (reception_data[FIRST_DATA] & 0x3F); | |
transmission_data[SECOND_DATA] = reception_data[SECOND_DATA]; | |
} | |
void TEA5767N::readStatus() { | |
Wire.requestFrom (TEA5767_I2C_ADDRESS, 5); | |
if (Wire.available ()) { | |
for (int i = 0; i < 5; i++) { | |
reception_data[i] = Wire.read(); | |
} | |
} | |
delay(100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment