TEA5767 - Populate List of Frequencies with Specific RSSI Value

Hey Guys -

Quick Question - I’m playing with a TEA5767 board and so far have a very simple script which can scan through the frequencies stopping at each for 100ms. I’ve yet to have it display the frequency + RSSI value in serial, but know its possible.

My goal is to create a script which allows one to “preview” a few seconds of each radio station with reception, but am not sure how to go about it.

The plan is that upon starting, the Arduino would scan all frequencies, obtaining their RSSI value, and populating a list including ones with a value of 7 or greater. Once the scan completes, it would then cycle through each of these stations for ~5 seconds each.

Here’s the simplistic script I have so far for the scanning. Any suggestions? Thanks!

#include <TEA5767.h>
#include <Wire.h>
#include <TEA5767Radio.h>

TEA5767Radio radio = TEA5767Radio();

void setup()
{
Serial.begin(9600);
unsigned char buf[5];
Wire.begin();
}
void loop ()
{

for ( int i = 750 ; i < 1100 ; i++ ) {
float freq = i/10.0 ;
radio.setFrequency(freq);
delay(25);
}
}

Please change the quote tags to the correct code tags. "Scripts" are codes written in interpretive languages. Arduinos run "source code", "programs", or "sketches".

You haven't explained what obstacles have prevented you from progressing. What is the problem? Have you had a good look at the TEA library example sketches and documentation?

for ( int i = 750 ; i < 1100 ; i++ ) {
  float freq = i/10.0 ;

  radio.setFrequency(freq);

So, set the freq value to 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 76, 76, etc.

Why? Incrementing i by 10 makes more sense. On the other hand, counting by 10 and then dividing the result by 10 makes no sense.

Presumably, loop() will (eventually) do something besides the scanning. Why isn’t what it does now in a subroutine that you call, or not, as needed?

Where do you read the RSSI value, and decide whether freq belongs in the list to be used later?

How many items will your list support?

It would behoove you to investigate the frequency step size of the IC, and the library functions that set it. It's the only way to do an efficient scan and not miss any frequencies.