cyborg5 / IRLib2

Library for receiving, decoding, and sending infrared signals using Arduino
GNU General Public License v3.0
384 stars 138 forks source link

nothing happens when sending #21

Closed d3xt3r01 closed 7 years ago

d3xt3r01 commented 7 years ago

So, I got an arduino mega2560 (overkill, I know) set up to listen...

#include "IRLibAll.h"

IRrecvPCI myReceiver(2);

IRdecode myDecoder;

void setup() {
  Serial.begin(115200);
  delay(2000); while (!Serial);
  myReceiver.enableIRIn();
  Serial.println(F("Ready to receive IR signals"));
}

void loop() {
  if(myReceiver.getResults()){
    myDecoder.decode();
    myDecoder.dumpResults(false);
    myReceiver.enableIRIn();
  }
}

Got a 1838 module, the result is:

Decoded NEC(1): Value:55AA25DA Adrs:0 (32 bits) 

Then I set up an arduino uno set up to send...

#include <IRLibSendBase.h>
#include <IRLib_P01_NEC.h> 
#include <IRLibCombo.h>
// tried #include "IRLibAll.h"

IRsend mySender;

void setup() {
  Serial.begin(115200);
  delay(2000); while (!Serial);
  Serial.println(F("Ready to send IR signals."));
}

void loop() {
    mySender.send(NEC, 0x55aa25da, 0); # tried 32 bits too :/
}

I have a normal small white led set up like this:

The reason I moved to a normal led is to try and see what I'm doing wrong when I tried with an IR led that wasn't working and I thought I got it burned. Later tests with a camera and + resistor / - test showed up the led working just fine. So I must be using the library wrong.

The final idea is to get rid of the bloat "peal" software on my samsung and write my own widget to send via Wifi ( ESP8266 maybe ? ) to an arduino micro to send the IR. I don't think I need a logitech remote. Also, the "peal" bloat is full of bugs and doesn't support ( even after I tried to talk to those guys and give them the info ) a small iogear wireless 5x2 matrix remote.

So, I have 2 questions: 1) should the normal led light up ? It's in a loop, the ir led showed up on camera when pushing the button, the led, being in a loop should also light up at least a little, right ? 2) what am I doing wrong when trying to use library ! Am I missing something ?

If I get it working, I suppose I could use the ir led with a C1815 ?

Sorry for the long issue.

d3xt3r01 commented 7 years ago

So, to answer my questions: 1) yes. 2) no. 3) seems to work with a c1815 The problem is pin9 when the default on this platform for some reason seems to be 3 ! Found that in IRLibProtocols/IRLibHardware.h . Right place, right ?

NOW IT WORKS. Thanks and sorry for the waste of time. Hope this will help others.