Class TEA5767 had no member named "set_frequency"

//Libraries:
#include <TEA5767.h>
#include <Wire.h>

//Constants:
TEA5767 Radio; //Pinout SLC and SDA - Arduino uno pins A5 and A4

//Variables:
double old_frequency;
double frequency;
int search_mode = 0;
int search_direction;
unsigned long last_pressed;
unsigned char buf[5];
int stereo;
int signal_level;
double current_freq;
unsigned long current_millis = millis();
int inByte;
int flag=0;

void setup () {
//Init
Serial.begin(9600);
Radio.init();
Radio.set_frequency(95.2); //On power on go to station 95.2
lcd.init();
lcd.backlight(); //backlight is now ON
lcd.begin(16,2);
lcd.clear();

}

void loop () {

if (Serial.available()>0) {
inByte = Serial.read();
if (inByte == '+' || inByte == '-'){ //accept only + and - from keyboard
flag=0;
}
}

if (Radio.read_status(buf) == 1) {
current_freq = floor (Radio.frequency_available (buf) / 100000 + .5) / 10;
stereo = Radio.stereo(buf);
signal_level = Radio.signal_level(buf);
//By using flag variable the message will be printed only one time.
if(flag == 0){
Serial.print("Current freq: ");
Serial.print(current_freq);
Serial.print("MHz Signal: ");
//Strereo or mono ?
if (stereo){
Serial.print("STEREO ");
}
else{
Serial.print("MONO ");
}
Serial.print(signal_level);
Serial.println("/15");
flag=1;
}
}

//When button pressed, search for new station
if (search_mode == 1) {
if (Radio.process_search (buf, search_direction) == 1) {
search_mode = 0;
}
}
//If forward button is pressed, go up to next station
if (inByte == '+') {
last_pressed = current_millis;
search_mode = 1;
search_direction = TEA5767_SEARCH_DIR_UP;
Radio.search_up(buf);
}
//If backward button is pressed, go down to next station
if (inByte == '-') {
last_pressed = current_millis;
search_mode = 1;
search_direction = TEA5767_SEARCH_DIR_DOWN;
Radio.search_down(buf);
}

Tried a lot of thing but cant find how to solve the problem

Class TEA5767 had no member named "set_frequency"

Did you try the examples that came with the library, do they compile OK ?

Exactly. There is a whole stack of different libraries with the same name for that device.

This one has a set_frequency() method: TEA5767/TEA5767.h at master · andykarpov/TEA5767 · GitHub

It could work for you.

i tried code that comes with library but it says uploading for ages and nothing happens

6v6gt:
Exactly. There is a whole stack of different libraries with the same name for that device.

This one has a set_frequency() method: TEA5767/TEA5767.h at master · andykarpov/TEA5767 · GitHub

It could work for you.

not working

Danielius2648:
not working

Well post a link to the site where you acquired all that software you posted in the OP. Someone here may have the patience to help you identify the correct library to use.

Danielius2648:
i tried code that comes with library but it says uploading for ages and nothing happens

That's very unlikely to be caused by using a specific library.

If you want help with that upload issue, we will need more information:

  • (In the Arduino IDE) File > Preferences
  • Uncheck the checkbox next to "Show verbose output during: compilation"
  • Check the checkbox next to "Show verbose output during: upload
  • Click "OK"
  • Sketch > Upload
  • When the upload hangs, click on the black console window at the bottom of the Arduino IDE window.
  • Press Ctrl + A. This will highlight all text in the console window.
  • Press Ctrl + C. This will copy the highlighted text to the cliboard.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the upload output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.