#include
<IRremote.h>
#include
<IRremoteInt.h>
int
RECV_PIN = 9;
IRrecv irrecv(RECV_PIN);
decode_results results;
int
E1 = 6;
//M1 Speed Control
int
E2 = 5;
//M2 Speed Control
int
M1 = 8;
//M1 Direction Control
int
M2 = 7;
//M2 Direction Control
void
setup(){
int
i;
for(i=5;i<=8;i++)
pinMode(i, OUTPUT);
Serial.begin(9600);
irrecv.enableIRIn();
}
void
loop(){
int
leftspeed = 255;
int
rightspeed = 255;
if
(irrecv.decode(&results)){
if(results.value == 16593103){
remote control
analogWrite
(E1,255);
digitalWrite(M1,HIGH);
analogWrite
(E2,255);
digitalWrite(M2,HIGH);
delay(1000);
}
digitalWrite(E1,LOW);
digitalWrite(E2,LOW);
irrecv.resume();
}
}
// Start the receiver
//255 is maximum speed
// This code will vary based on your
// Receive the next value
31