Hi guys, I'm making an RF bot and I want to know if I could send alphabets like 'w', 'a' etc. via the transmitter or only binary digits (0, 1). Also, I'm looking forward to solder a wire as an antenna. Is it helpful to hook up a wire as an antenna? Thanks for all the help
. Here's my code
//Transmitter Code (Nano)
#include <VirtualWire.h>
void setup()
{
 Serial.begin(9600);
Â
 vw_setup(2000);
 vw_set_tx_pin(7);
}
void loop()
{
 if(Serial.available())
 {
  char c = Serial.read();
 Â
  if(c == 'w')
  {
   vw_send((uint8_t *)c, 1);
  }
  else if(c == 's')
  {
   vw_send((uint8_t *)c, 1);
  }
  else if(c == 'a'){
   vw_send((uint8_t *)c, 1);
  }
  else if(c == 'd')
  {
   vw_send((uint8_t *)c, 1);
  }
  else if (c == 'x'){
   vw_send((uint8_t *)c, 1);
  }
 Â
 }
}
//Reciever Code (Uno)
#include <VirtualWire.h>
#include <AFMotor.h>
AF_DCMotor motor1(1);
AF_DCMotor motor2(2);
void setup()
{
motor1.setSpeed(175);
motor2.setSpeed(175);
Â
 vw_setup(2000);
 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, &buflen))
 {
  for(int i = 0;i < buflen;i++)
  {
   if(buf[i] == 'w')
   {
    motor1.run(FORWARD);
    motor2.run(FORWARD);
   }
   else if(buf[i] == 'a')
   {
    motor1.run(BACKWARD);
    motor2.run(FORWARD);
   Â
   }
   else if (buf[i] == 's') {
    motor1.run(BACKWARD);
    motor2.run(BACKWARD);
   }
   else if(buf[i] == 'd'){
    motor1.run(FORWARD);
    motor2.run(BACKWARD);
  }
  else if(buf[i] == 'x'){
   motor1.run(RELEASE);
   motor2.run(RELEASE);
  }
 }
 }
}
