Was trying to get RSSI, but "call of overloaded ... is ambiguous"

That’s my first Arduino programming trial. I am trying to write a code which helps me use 2 HC05 modules(one master and one slave) to get RSSI value as base 10 number. I will use is to measure distance later.

I don’t have Arduino or Hc05 yet, I am writing the code by the program I downloaded from here, and DEV++. I wrote some parts directly there, until the part which asks HC05 for RSSI value. Then, I wrote some additional codes on DEV++ which takes a string, seperates the last 4 digit and makes it a base 10 number(basically turn RSSI to a number)
At the end, I united them to make one working code. I hope it works when I upload it to Arduino.

However, the case is; it gives some error reports.
(EDİT: I was writing first version of the program before uniting them, but ıt seems I cannot write more than 9000 words :/)
that one is what I wrote on DEV++

#include <stdio.h>
#include <math.h>
int main()
{
        double RSSI;
        char c[13]="kt000011";
        int i;
        int carpan[3];
int m=0;
                printf("---\n");

        while(c[i]!=0)
        {
                printf("%c", c[i]);
                i++;
                m++;
        }
        //printf("\n%d", m);
//      printf("\n%d", i);
        int y=m-4;
        int f;
        char k[4];
        i=0;
        for(f=y;f<=y+3;f++)
        {
        k[i]=c[f];
        i++;
        }
        //      printf("\n\n%s", k);


        for(i=0;i<=3;i++)
        {

        if(k[i]=='0')
                // RSSI=RSSI+0*pow(16,3-i);
                carpan[i]=0;
          if(k[i]=='1')
                 // RSSI=RSSI+1*pow(16,3-i);
                 carpan[i]=1;
          if(k[i]=='2')
                 // RSSI=RSSI+2*pow(16,3-i);
                  carpan[i]=2;
          if(k[i]=='3')
                 // RSSI=RSSI+3*pow(16,3-i);
                  carpan[i]=3;
                if(k[i]=='4')
                 // RSSI=RSSI+4*pow(16,3-i);
                  carpan[i]=4;
          if(k[i]=='5')
                 // RSSI=RSSI+5*pow(16,3-i);
                  carpan[i]=5;
          if(k[i]=='6')
                 // RSSI=RSSI+6*pow(16,3-i);
                  carpan[i]=6;
          if(k[i]=='7')
                 // RSSI=RSSI+7*pow(16,3-i);
                  carpan[i]=7;
                if(k[i]=='8')
                 // RSSI=RSSI+8*pow(16,3-i);
                  carpan[i]=8;
          if(k[i]=='9')
                  //RSSI=RSSI+9*pow(16,3-i);
                  carpan[i]=9;
          if(k[i]=='A')
                 // RSSI=RSSI+10*pow(16,3-i);
                  carpan[i]=10;
          if(k[i]=='B')
                 // RSSI=RSSI+11*pow(16,3-i);
          carpan[i]=11;
                if(k[i]=='C')
                 // RSSI=RSSI+12*pow(16,3-i);
                carpan[i]=12;
          if(k[i]=='D')
                 // RSSI=RSSI+13*pow(16,3-i);
                carpan[i]=13;
          if(k[i]=='E')
                 // RSSI=RSSI+14*pow(16,3-i);
                carpan[i]=14;
          if(k[i]=='F')
                 // RSSI=RSSI+15*pow(16,3-i);
                carpan[i]=15;







        }
        for(i=0;i<=3;i++)
        {
        RSSI=RSSI+carpan[i]*pow(16,3-i);
        }
        printf("\n%f", RSSI);
        return 0;
}

By error reports and looking on reference etc…, I united them as

#include<SoftwareSerial.h> 
//RX TX tipi bilgiyi kullanmak için kütüphane gerekti. RX-TX tipi girişleri de kullanırdık ama bu daha rahat gözüktü bir an...
SoftwareSerial HCSerial(24,25); // RX,TX
//RX UART input, TX ise output. Kartın zıttının bağlanması gerekiyor.
SoftwareSerial HC2Serial(38,40); //RX,TX
//3.3 volt ve grd kullanılacak.
int key1=22;
int key2=41;
String MyString;
double RSI;
void setup() {/* RX-TX tanımı yapılmış pin için ayrıca input-output tanımı gerekmiyor.
*/
pinMode(key1, OUTPUT);
pinMode(key2, OUTPUT);
Serial.begin(38400);
digitalWrite(key1, HIGH); 
Serial.println("Sensor1AT");
delay(1000);
HCSerial.begin(38400);
HCSerial.print("AT+NAME=");
HCSerial.println("Companion");
delay(1000);
HCSerial.print("AT+PSWD=");
HCSerial.println("1234");
delay(1000);
HCSerial.print("AT+UART=");
HCSerial.println("38400,0,0");
delay(2000);
HCSerial.print("AT+INIT\r\n");
HCSerial.print("AT+CMODE=");
HCSerial.println("1");
delay(2000);
HCSerial.print("AT+ROLE=");
HCSerial.println("1");
delay(2000);
HCSerial.print("AT+IAC=");
HCSerial.println("9e8b33");
delay(2000);
HCSerial.print("AT+CLASS=");
HCSerial.println("0");
delay(2000);
HCSerial.print("AT+INQM=");
HCSerial.println("1,1,48");
delay(2000);

Serial.println("Yarısıbitti.");
digitalWrite(key2, HIGH); 
HC2Serial.begin(38400);
HC2Serial.print("AT+NAME=");
HC2Serial.println("Companion2");
delay(1000);
HC2Serial.print("AT+PSWD=");
HC2Serial.println("1234");
delay(1000);
HC2Serial.print("AT+UART=");
HC2Serial.println("38400,0,0");
delay(2000);
HC2Serial.print("AT+ROLE=");
HC2Serial.println("0");
delay(2000);
HC2Serial.print("AT+CMODE=");
HC2Serial.println("0");
delay(2000);

digitalWrite(key1, LOW); 
digitalWrite(key2, LOW); 
Serial.println("bitti.");
}

void loop() {
  
HCSerial.println("AT+INQ");
MyString=HCSerial.readString();


  
  

        int i;
        int carpan[3];
int m=0;
                

        while(MyString[i]!=0)
        {
               
                i++;
                m++;
        }

        int y=m-4;
        int f;
        char k[4];
        i=0;
        for(f=y;f<=y+3;f++)
        {
        k[i]=MyString[f];
        i++;
        }
       


        for(i=0;i<=3;i++)
        {

        if(k[i]=='0')
                carpan[i]=0;
         
          if(k[i]=='1')
                 carpan[i]=1;
          
          if(k[i]=='2')
                 carpan[i]=2;
          
          if(k[i]=='3')
                 carpan[i]=3;
                
                if(k[i]=='4')
           carpan[i]=4;
          
          if(k[i]=='5')
                 carpan[i]=5;
         
          if(k[i]=='6')
                 carpan[i]=6;
          
          if(k[i]=='7')
                 carpan[i]=7;
                
                if(k[i]=='8')
               carpan[i]=8;
          
          if(k[i]=='9')
                  carpan[i]=9;
          
          if(k[i]=='A')
               carpan[i]=10;
          
          if(k[i]=='B')
           carpan[i]=11;
                
                if(k[i]=='C')
              carpan[i]=12;
          
          if(k[i]=='D')
                 carpan[i]=13;
          
          if(k[i]=='E')
                 carpan[i]=14;
          
          if(k[i]=='F')
                carpan[i]=15; 







        }
        
        for(i=0;i<=3;i++)
        {
        RSI=RSI+carpan[i]*pow(16,3-i);
        } 
        Serial.print("\n");
        
        Serial.print("%f", (double)RSI);
   
  

}

When I compile, it gives a error report like
http://hizliresim.com/OMaZv4
http://hizliresim.com/o7yZd9

But the interesting is, when I just delete Serial.print("%f", (double)RSI); part, It works without any mistake(except timeout ones) :confused:
I searched that mistake type and tried something(like writing (double)RSI etc…) and did not work either :confused:

And I don’t know what more to do… Would be helpful ıf you help me about finding the mistake
thanks…

When I compile, it gives a error report like http://hizliresim.com/OMaZv4 http://hizliresim.com/o7yZd9

Please just post the errors instead of requiring a visit to a strange website.

The IDE already knows how to handle printing a double value. No need for a format string. Instead of:-Serial.print("%f", (double)RSI);try:-Serial.print(RSI);

As per this example:-

void setup()
{
    Serial.begin(115200);
    double dVal=3.12;
    Serial.print(dVal);  // Prints: 3.12
}

void loop(){}

Edit: Not sure about other errors, I didn't look further. As aarg says, post your errors here, (in code tags please).

aarg: Please just post the errors instead of requiring a visit to a strange website.

9000 word limit

OldSteve: The IDE already knows how to handle printing a double value. No need for a format string. Instead of:-Serial.print("%f", (double)RSI);try:-Serial.print(RSI);

As per this example:-

void setup()
{
    Serial.begin(115200);
    double dVal=3.12;
    Serial.print(dVal);  // Prints: 3.12
}

void loop(){}




Edit: Not sure about other errors, I didn't look further. As aarg says, post your errors here, (in code tags please).

It worked :) Now just does not work for Arduino Mega, I will continue searching. Thanks :)

What doesn't work on a Mega? Are you trying to use software serial? If so, why? You have 4 hardware serial ports.

SurferTim: What doesn't work on a Mega? Are you trying to use software serial? If so, why? You have 4 hardware serial ports.

I wrote Serial1 instead and worked.(was writing on reference) But I still did not get the case of this command. Do I always have to start with Serial.begin or Serial1.begin? I don't even use these pins. :/ I cannot be sure before uploading this code though..

I will use is to measure distance later.

No, you won't. There is a very poor correlation between RSSI and distance.