Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shows how to update transmission data after status bytes are read in reception_data
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