Arduino IR remote Sensor L293D - DOUBLE BRIDGE H 600MA

My first Arduino Test IR remote Sensor L293D - DOUBLE BRIDGE H 600MA.
Mecanno car . I replced the engine from an RC car , and a servo.
Installed an IR receptor , arduino default package remote control
and some code ... :)
Enjoy :)

//27-07-2013 For Instructable
//Arduino / Servo / IR / Meccano / L293D
#include <IRremote.h>
#include <Servo.h>
int RECV_PIN = 6;
//IR receiver
IRrecv irrecv(RECV_PIN);
decode_results results;
Servo myservo;// Servo Object
int servoPin = 9;//Servo control PIN
int reversePin = 10;//Back PIN
int forwardPin = 11; //forward PIN
void setup()
irrecv.enableIRIn(); // Start IR receiver
pinMode(reversePin, OUTPUT);
pinMode(forwardPin, OUTPUT);

void loop()
myservo.write(22); //Center Position
if (irrecv.decode(&results))
long int decCode = results.value;
switch (results.value)
case 16718055: Serial.println("Forward"); digitalWrite(reversePin, LOW); digitalWrite(forwardPin, 100); // positiv value OR HIGH break; case 16730805: Serial.println("Reverse"); digitalWrite(forwardPin, LOW); digitalWrite(reversePin, 100); break;
case 16734885: Serial.println("Servo Right"); myservo.write(22); delay(500); myservo.write(30); delay(500); myservo.write(40); delay(1000); myservo.write(30); delay(500); myservo.write(22); break;
case 16716015: Serial.println("Servo Left"); myservo.write(22); delay(500); myservo.write(15); delay(500); myservo.write(5); delay(1000); myservo.write(22); break;
case 16726215: Serial.println("Stop"); digitalWrite(forwardPin, LOW); digitalWrite(reversePin, LOW); break; default: Serial.println("Waiting ...");
irrecv.resume(); // Receive the next value from IR
Need your help about motor speed? Any ideas?

About This Instructable


13 favorites


More by affiaymen: How to hack digital Infra Red switch to make analogic IR distance sensor Arduino simple Hand Motion v1 Arduino IR remote Sensor L293D - DOUBLE BRIDGE H 600MA
Add instructable to: