Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shows the algorithm to get que optimal Hi/Lo injection prior to a select frequency command.
void TEA5767N::selectFrequency(float frequency) {
calculateOptimalHiLoInjection(frequency);
transmitFrequency(frequency);
}
void TEA5767N::calculateOptimalHiLoInjection(float freq) {
byte signalHigh;
byte signalLow;
setHighSideLOInjection();
transmitFrequency((float) (freq + 0.45));
signalHigh = getSignalLevel();
setLowSideLOInjection();
transmitFrequency((float) (freq - 0.45));
signalLow = getSignalLevel();
hiInjection = (signalHigh < signalLow) ? 1 : 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment