I have searched the whole arduino to get a solution for this problem
I'm trying to make a 4ch RC transmitter and receiver
If this project gets the correct solution
I will Create a detailed easy instructables for rx and tx (Will be upgraded to 8channels)
I am experiencing a Error for which I could not find a solution even after searching the whole internet for 3 weeks. Hence I have come to you guys for help
Transmitter has no issues
but Receiver shows compilation problems
I want to use Servos with Virtual library
There are some forums advising us to use
<ServoTimer2.h>
instead of <Servo.h>
BUT that too does not work for me
The codes
Receiver:- Arduino Nano V3
#include <VirtualWire.h>
#include <ServoTimer2.h>Â //only this causes the error
uint8_t data[25];
void setup()
{
 Serial.begin(115200); // Debugging only
 Serial.println("Receiving");
 pinMode(13,OUTPUT);
 // Initialise the IO and ISR
 //vw_set_ptt_inverted(true); // Required for DR3100
 vw_setup(2000); // Bits per sec
 vw_set_rx_pin(8);
 vw_rx_start();   // Start the receiver PLL running
}
void loop()
{
 uint8_t buf[VW_MAX_MESSAGE_LEN];
 uint8_t buflen = VW_MAX_MESSAGE_LEN;
 if (vw_get_message(buf, &buflen)) // Non-blocking
 {
  int X = atoi(strtok((char*)buf, ",")); // Look for a comma, the return the data before it.
  int Y = atoi(strtok(NULL, ",")); // same as above
  int Z = atoi(strtok(NULL, ".")); // Look for a period, then return data before it.
  Serial.print(X); // X axis
  Serial.print(", ");
  Serial.print(Y); // Y axis
  Serial.print(", ");
  Serial.print(Z); // Z axis
  Serial.println();
 }
}
Transmitter:
#include <VirtualWire.h>
char Array[20];
int X,Y,Z;
void setup()
{
 Serial.begin(115200); // Debugging only
 Serial.println("Sending"); // Debugging only
 // Initialise the IO and ISR
 //vw_set_ptt_inverted(true); // Required for DR3100
 vw_setup(2000); // Bits per sec
 vw_set_tx_pin(33); //RF sending pin
}
void loop()
{
 X = analogRead(A14),410,345,0,255)
 Y = analogRead(A15),415,275,0,255)
 Z = analogRead(A13),310,410,0,255)
Â
 sprintf(Array, "%d,%d,%d.",X,Y,Z);
 vw_send((uint8_t*)Array, strlen(Array));
 vw_wait_tx();
}
I'm still an intermediate
I kindly request you guys to help me if you wish