Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Pages: 1 [2]   Go Down
Author Topic: Ricevitore IR apre relè  (Read 2434 times)
0 Members and 1 Guest are viewing this topic.
Capo d'Orlando
Offline Offline
God Member
*****
Karma: 1
Posts: 563
Electronics & Web Dev, Unix User, Ω LEO, Rock/Deep Music, Tech/Science/Finance addicted, Ski/Snowboard and much more …
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Quando apro il monitor di arduino, mi da tuti questi valori
Code:
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 !!!!
 smiley-sad smiley-sad smiley-sad smiley-sad smiley-sad
Logged


Capo d'Orlando
Offline Offline
God Member
*****
Karma: 1
Posts: 563
Electronics & Web Dev, Unix User, Ω LEO, Rock/Deep Music, Tech/Science/Finance addicted, Ski/Snowboard and much more …
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Olè !!!

Code:
#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);
 
 }

 }
Logged


Pages: 1 [2]   Go Up
Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Jump to: