I want to make a universal remote for controlling a car, boat and such. Therefore I need a radio reciever, to calibrate the arduino with the remote for the car and a transmitter to sent the waves to the model from the arduino. It is for an analog system. Does somebody know a shield or does somebody have a schematic to make this happen. And can somebody sent me more info about how those waves work and how i could replicate them?
#include <AFMotor.h> // include motorshield library
AF_DCMotor motor1(3); // name motor and tell it to use motorshield M3
int PPMin1 = 14; // connect the desired channel (PPM signal) from your RC receiver to analog pin 0 (pin 14) on Arduino.
int RCval1; // store RC signal pulse length
int adj_val1; // map that value to be between 0-255
void setup()
{
Serial.begin(9600); //serial library start
pinMode(PPMin1, INPUT); //Pin 14 as input
// turn on motor
motor1.setSpeed(250);
motor1.run(RELEASE);
}
void loop()
{
RCval1 = pulseIn(PPMin1, HIGH, 20000); //read RC channel 1
adj_val1 = map(RCval1, 630, 1125, 0, 255); // my observed RC values are between 630-1125.. these might need to be changed, depending on your RC system.
//motor1
if (adj_val1 > 136) {
motor1.run(BACKWARD);
motor1.setSpeed(adj_val1 - 36);
}
else if (adj_val1 < 120) {
motor1.run(FORWARD);
motor1.setSpeed(220 - adj_val1);
}
else{
motor1.run(RELEASE);
}
Serial.print ("val1: ");
Serial.print (RCval1); // if you turn on your serial monitor you can see the readings.
Serial.print (" ");
Serial.print ("adjusted: ");
Serial.print (adj_val1);
Serial.println (" ");
}
Hey tnx for the info, but maybe should I explain my project more. The arduino will be the communicator between a smartphone and a rc car. Meaning that it wont be on the car but next with the user.
OH....Sorry for providing you with the wrong info, but ok....Maybe this instructable will give you a few ideas. Instead of building a transmitter from scratch, you can use the arduino to connect the controller to your phone thus controlling your RC device with your smartphone. Here is the link: