title: Sending a message from one arduino to the other using 433 mhz transmitter/receiver
body: <p>Today I got some cool radio receiver and transmitter the problem is that when I type the message I want to send it spits out gibbirish on the other arduino.</p>
  
  <pre><code>//transmitter
  #include &lt;VirtualWire.h&gt;
  
  void setup()
  {
    Serial.begin(9600);
    vw_set_ptt_inverted(true);
    vw_setup(3000);
    vw_set_tx_pin(7);
  }
  
  void loop()
  {
    String inData;
  
    while(Serial.available())
    {
      char recieved = Serial.read();
      inData += recieved; 
      char bits[inData.length()];
  
      Serial.print(":");
      Serial.print(inData);
  
  
      for(int i=0;i&lt;inData.length();i++)
      {
      bits[i] = inData.charAt(i);
  
      vw_send((uint8_t *)bits[i], 1);
      }
  
      inData = "";
      delay(50);
    }
  }
  </code></pre>
  
  <p>//below is the receiver!</p>
  
  <pre><code>#include &lt;VirtualWire.h&gt;
  
  void setup()
  {
    vw_set_ptt_inverted(true);
    pinMode(13,OUTPUT);
    digitalWrite(13,LOW);
    Serial.begin(9600);
    vw_setup(3000);
    vw_set_rx_pin(7);
    vw_rx_start();
  }
  
  void loop()
  {
    uint8_t buflen = VW_MAX_MESSAGE_LEN;
    uint8_t buf[buflen];
  
    if(vw_get_message(buf, &amp;buflen))
    {
      for(int i = 0;i &lt; buflen;i++)
      {
       char c = buf[i];
       Serial.println(c,DEC);
  
        delay(50);
      }
    }
  }
  </code></pre>
  
  <p>So if i type in "hello", on the other serial port I will see "0 53 0 0 2" which is weird due to the fact that I always get the same amount of characters but not the actual character I want.</p>