user41367: I have the following code:
      uint8_t buf[1];
      uint8_t buflen = 1;
      if (driver.recv(buf, &buflen)) // Non-blocking
         {
            int i;
            // Message with a good checksum received, dump it.
            Serial.print("Message: ");
            Serial.println((char*)buf);//this prints out okay
            highPins[(char*)buf] = 1;
         }

The problem is in highPins[(char*)buf]. highPins is array, and in (char*)buf I get index number. When I display it with Serial.println, it shows the number, but here it does not. I am guessing its because (char*)buf is not a number. I have tried to convert it to int with few functions I have found online, but it was unsuccessful. Any help is appreciated :)

user84: I would suggest improving your code slightly as follows:
  uint8_t buf;
  uint8_t buflen = 1;
  if (driver.recv(&buf, &buflen)) // Non-blocking
     {
        int i;
        // Message with a good checksum received, dump it.
        Serial.print("Message: ");
        Serial.println(buf);//this prints out okay
        highPins[buf] = 1;
     }

The important point is that you do not need to declare buf as an array of just one element, but just declare the element itself (as uint8_t) and pass its address (&buf) to driver.recv(...).
As @Majenko suggested, you should alos check buf before using it as an index to highPins array, in order to avoid using an index bigger than teh array size.

41367: <p>I have the following code:</p>

<pre><code>      uint8_t buf[1];
      uint8_t buflen = 1;
      if (driver.recv(buf, &amp;buflen)) // Non-blocking
         {
            int i;
            // Message with a good checksum received, dump it.
            Serial.print("Message: ");
            Serial.println((char*)buf);//this prints out okay
            highPins[(char*)buf] = 1;
         }
</code></pre>

<p>The problem is in highPins[(char*)buf]. highPins is array, and in (char*)buf I get index number. When I display it with Serial.println, it shows the number, but here it does not. I am guessing its because (char*)buf is not a number. I have tried to convert it to int with few functions I have found online, but it was unsuccessful. Any help is appreciated :)</p>
 84: <p>I would suggest improving your code slightly as follows:</p>

<pre><code>  uint8_t buf;
  uint8_t buflen = 1;
  if (driver.recv(&amp;buf, &amp;buflen)) // Non-blocking
     {
        int i;
        // Message with a good checksum received, dump it.
        Serial.print("Message: ");
        Serial.println(buf);//this prints out okay
        highPins[buf] = 1;
     }
</code></pre>

<p>The important point is that you do not need to declare <code>buf</code> as an array of just one element, but just declare the element itself (as <code>uint8_t</code>) and pass its address (<code>&amp;buf</code>) to <code>driver.recv(...)</code>.</p>

<p>As @Majenko suggested, you should alos check <code>buf</code> before using it as an index to <code>highPins</code> array, in order to avoid using an index bigger than teh array size.</p>
