Go Down

Topic: Ricevitore IR apre relè (Read 2781 times) previous topic - next topic

anerDev

Di programmare lo so fare, ma non capisco cosa intendi !!!

Quando apro il monitor di arduino, mi da tuti questi valori
Code: [Select]
1FE50AF
FFFFFFFF
1FED827
FFFFFFFF
1FEF807
1FE30CF
FFFFFFFF
1FEB04F
FFFFFFFF
1FE708F
FFFFFFFF
FFFFFFFF
1FEF00F
FFFFFFFF


ogni valore corrisponde ad un pulsante ... Ma non riesco ancora a capire cosa intendi con "valoreletto == Valorechetiinteressa " !!!!

Mi legge tutti i valori del telecomando, ma a ma servono specifici valori !!!!
:( :( :( :( :(

anerDev

Olè !!!

Code: [Select]
#include <IRremote.h>

int led1 = 12;
int led2 = 11;
int led3 = 10;
int led4 = 9;
int led5 = 8;
int RECV_PIN = 7;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()

  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(led4, OUTPUT);
  pinMode(led5, OUTPUT);
}

void loop() {
   if (irrecv.decode(&results)) {
   Serial.println(results.value, DEC);


   if(results.value == 33480735)
     digitalWrite(led1, HIGH);   
     delay(100);
     digitalWrite(led1, LOW); 
     
     irrecv.resume();
     
    if(results.value == 33444015) 
     digitalWrite(led2, HIGH);   
     delay(100);
     digitalWrite(led2, LOW);   
     
     irrecv.resume();
     
    if(results.value == 33478695) 
     digitalWrite(led3, HIGH);   
     delay(100);
     digitalWrite(led3, LOW);
     
     irrecv.resume();
     
    if(results.value == 33486855) 
     digitalWrite(led4, HIGH);   
     delay(100);
     digitalWrite(led4, LOW);
     
     irrecv.resume();
     
    if(results.value == 33435855) 
     digitalWrite(led5, HIGH);   
     delay(100);
     digitalWrite(led5, LOW);
 
}

}


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy