Skip to content

Instantly share code, notes, and snippets.

@mroger
Created August 23, 2014 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mroger/3cbb3ff3a4965132ef85 to your computer and use it in GitHub Desktop.
Save mroger/3cbb3ff3a4965132ef85 to your computer and use it in GitHub Desktop.
Search next method
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