Created
August 23, 2014 13:55
-
-
Save mroger/3cbb3ff3a4965132ef85 to your computer and use it in GitHub Desktop.
Search next method
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
byte TEA5767N::searchNext() { | |
byte bandLimitReached; | |
if (isSearchUp()) { | |
selectFrequency(readFrequencyInMHz() + 0.1); | |
} else { | |
selectFrequency(readFrequencyInMHz() - 0.1); | |
} | |
//Turns the search on | |
transmission_data[FIRST_DATA] |= 0b01000000; | |
transmitData(); | |
while(!isReady()) { } | |
//Read Band Limit flag | |
bandLimitReached = isBandLimitReached(); | |
//Loads the new selected frequency | |
loadFrequency(); | |
//Turns de search off | |
transmission_data[FIRST_DATA] &= 0b10111111; | |
transmitData(); | |
return bandLimitReached; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment