title: Arduino Invalid conversion from 'char' to 'char*'
body: <p>This is really giving me hard time; this simple logic. I will explain how things are going and what I am trying to achieve at this point. </p>
  
  <p>I have an ESP8266 module programed to subscribe to a topic "switches" on a server running Mosquitto MQTT Server.</p>
  
  <p>From any device having MQTT Client, I am able to publish a message to this topic (switches) and send this message through serial using the callback function below.</p>
  
  <pre><code>    void callback(char* topic, byte* payload, unsigned int length) { 
  
      for (int i = 0; i &lt; length; i++) {
         Serial.print((char)payload[i]);
      }
        Serial.println();
      }
  </code></pre>
  
  <p>On the Arduino side I am trying to process whatever is coming through the serial port and turn on/off digital pins on the Arduino.</p>
  
  <p>At this point on the Arduino, I have the following simple piece of code that receives bytes and store it in a variable "Recieved_Bytes" and then I am trying to convert those bytes to characters using another variable "Recieved_Message" of type char.</p>
  
  <pre><code>void loop(){
  
    if(esp8266.available()){ // check if the esp is sending a message 
  
        int Recieved_Bytes = esp8266.read(); //Byte Data
        char Recieved_Message = Serial.write(Recieved_Bytes); // char data;
        GetNumber(Recieved_Message);
  
     }
  </code></pre>
  
  <p>Everything is fine by far, however when I try to pass this "Recieved_Message" to a function that should return the integer value of what is being sent.</p>
  
  <pre><code>const char * Names[] = {"SwitchOne", "SwitchTwo", "SwitchThree", "SwitchFour", "SwitchThirteen"};
  const int Numbers[] = {1,2,3,4,13};
  
  int GetNumber(char *name) {
     for (int i=0; i &lt; sizeof Names / sizeof Names[0]; i++) {
         if (strcmp(name, Names[i]) == 0)
              return Numbers[i];
     }
     return -1;  // No match found
  }
  </code></pre>
  
  <p>I receive an error - below.</p>
  
  <pre><code>PIO_ESP_Control:6: error: initializing argument 1 of 'int GetNumber(char*)' [-fpermissive]
  invalid conversion from 'char' to 'char*' [-fpermissive]
  </code></pre>
  
  <p>NOTE: Assuming that I will be sending a message "SwitchOne" for example</p>
  
  <pre><code>mosquitto_pub -t switches -m "SwitchOne"
  </code></pre>
  
  <p>The question is, what is it that I am doing wrong and how can I fix it? Thanks for your help in advance.</p>