Created
August 23, 2014 02:37
-
-
Save mroger/19a5640b30ac32da7b63 to your computer and use it in GitHub Desktop.
Shows the algorithm to get que optimal Hi/Lo injection prior to a select frequency command.
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::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