#include
//
int RECV_PIN = 11;
//int LED_PIN = 13;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
// pinMode(LED_PIN, OUTPUT);
// digitalWrite(LED_PIN, HIGH);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
if (results.value == 0xFF30CF) //1
{
digitalWrite(8, LOW);
digitalWrite(9, HIGH);
}
else if (results.value == 0xFF18E7) //2
{ digitalWrite(9, LOW); digitalWrite(8, HIGH);}else if (results.value == 0xFF7A85) //3{ digitalWrite(8, LOW); digitalWrite(9, LOW);}irrecv.resume(); // Receive the next value }
delay(100);
}
#include
//
int RECV_PIN = 11;
//int LED_PIN = 13;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
// pinMode(LED_PIN, OUTPUT);
// digitalWrite(LED_PIN, HIGH);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
if (results.value == 0xFF30CF) //1
{
digitalWrite(8, LOW);
digitalWrite(9, HIGH);
}
else if (results.value == 0xFF18E7) //2
{ digitalWrite(9, LOW); digitalWrite(8, HIGH);}else if (results.value == 0xFF7A85) //3{ digitalWrite(8, LOW); digitalWrite(9, LOW);}irrecv.resume(); // Receive the next value }
delay(100);
}
举报