How solve?

Hello, i try control dmx with IR

#include <lib_dmx.h> 
#include <IRremote.h>
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); // RX, TX
#define DMX512 (0) 
int RECV_PIN = 3;
IRrecv irrecv(RECV_PIN);

decode_results results;

void setup() 
{
mySerial.begin(9600);
irrecv.enableIRIn();
ArduinoDmx1.set_tx_address(3); 
ArduinoDmx1.set_tx_channels(512); 
ArduinoDmx1.init_tx(DMX512); 
ArduinoDmx1.set_control_pin(18);
}



void loop()
{ 
  mySerial.println("ahoj");
  if (irrecv.decode(&results)) {
    mySerial.println(results.value);
    irrecv.resume(); // Receive the next value
  }
 switch(results.value)

  {

  case 16750695:  
    ArduinoDmx1.TxBuffer[0] = 100;
    mySerial.println("ahojhh");
    delay(100);
    break;
    
   }
}

But it still no work. I don´t receive IR

How solve it? Please help me.
I have arduino pro mini

But it still no work.

what no work?
what you get?

IR not work .. not receive any data from IR Remote

mySerial.println("ahoj");
  if (irrecv.decode(&results)) {
    mySerial.println(results.value);
    irrecv.resume(); // Receive the next value
  }
 switch(results.value)

Why not print the values you are receiving?

Yes, why? :slight_smile: I dont receive any data. Then switch not work

(ahoj and ahojhh are mark, or steps for easier watch when program is running)

What is attached to pin 3?


It´s attached to pin 3.

Do you have a reference for an "IR detector"?

I try IR communication with this code:

#include <IRremote.h>
int RECV_PIN = 3;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver  
}
void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); 
  } 
}

and this:

It´s works. But when I try with softwareserial, then it doesn´t work.

#include <IRremote.h>
#include <DmxSimple.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 4); // RX, TX
int RECV_PIN = 3;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
  mySerial.begin(9600);
  irrecv.enableIRIn(); 
}
void loop() {
  if (irrecv.decode(&results)) {
    mySerial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }  
}

So? :roll_eyes:

So - Do you have a reference or link for an "IR detector"?

This?

And the demodulation frequency of that device matches your transmitter?

Yes, when i try with this code, it works (it writes on serial monitor hexa codes for all buttons on transmitter), but when i use software serial, it doesn´t work.

#include <IRremote.h>
int RECV_PIN = 3;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver  
}
void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); 
  } 
}

I think you really have to make up your mind. Is pin 3 the IR receive pin, or is it the SoftwareSerial Rx pin?

Pin 3 is receiver from IR LED... I want to solve communication between IR and DMX with software serial. Becasue it isn´t work together. My other topic is this:
http://forum.arduino.cc/index.php?topic=222470.0

No you have a pin 3 on the arduino. That is what we want to know what is connected to it.
This is NOT thepin 3 on your sensor.

This is connected to arduino (1838b)

You. Ust make sure your English language skills are good enough to understand the replies before asking a question.
Yes I know that is connected to the arduino.
What everyone wants to know is what is connected to pin 3 of the arduino.

Sorry for my bad english :~ Is this what you want?