Quantcast
Channel: Arduino Polska Forum - Wszystkie działy
Viewing all articles
Browse latest Browse all 256

Odbiornik IR- powiadomienia diodami LED

$
0
0
Cześć,

Robię projekt odbierania sygnałów przez piloty posiadające nadajnik IR. Prawidłowo odbieram kody, lecz chciałem dodać powiadomienia diodami. Czerwona dioda sygnalizuje otrzymany już kod, natomiast zielona dioda sygnalizuje nowy kod. 
Sygnał jest podawany na wyjścia, lecz diody się nie świecą, sprawdzałem przykładając + z buzzera czy w ogóle podaje sygnał.


Dodam, że dopiero zaczynam przygodę z Arduino. Dołączam kod oraz schemat.

#include &tIRremote.hpp&t
int RECV_PIN = 10;
IRrecv irrecv(RECV_PIN);
decode_results results;
int redPin = 6;
int greenPin = 3;

void setup()
{
Serial.begin(9600);
IrReceiver.begin(RECV_PIN, ENABLE_LED_FEEDBACK); // Start the receiver
irrecv.blink13(true);
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  irrecv.enableIRIn();
}
void loop() {
if (IrReceiver.decode()) {
Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX); // Print "old" raw data
/* USE NEW 3.x FUNCTIONS */
IrReceiver.printIRResultShort(&Serial); // Print complete received data in one line
IrReceiver.printIRSendUsage(&Serial); // Print the statement required to send this data
IrReceiver.resume(); // Enable receiving of the next value

switch(&results){
          case 0xFB020707: //Keypad button "5"
          digitalWrite(redPin, HIGH);
          delay(2000);
          digitalWrite(redPin, LOW);
          }

        switch(&results){
          case 0xFB040707: //Keypad button "2"
          digitalWrite(greenPin, HIGH);
          delay(2000);
          digitalWrite(greenPin, LOW);
          }

        irrecv.resume();
}
}


Dziękuję za pomoc Smile

Viewing all articles
Browse latest Browse all 256

Trending Articles


TRX Antek AVT - 2310 ver 2,0


Автовишка HAULOTTE HA 16 SPX


POTANIACZ


Zrób Sam - rocznik 1985 [PDF] [PL]


Maxgear opinie


BMW E61 2.5d błąd 43E2 - klapa gasząca a DPF


Eveline ➤ Matowe pomadki Velvet Matt Lipstick 500, 506, 5007


Auta / Cars (2006) PLDUB.BRRip.480p.XviD.AC3-LTN / DUBBING PL


Peugeot 508 problem z elektroniką


AŚ Jelenia Góra