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
system
March 1, 2014, 6:00pm
4
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? I dont receive any data. Then switch not work
(ahoj and ahojhh are mark, or steps for easier watch when program is running)
system
March 1, 2014, 6:11pm
6
What is attached to pin 3?
system
March 1, 2014, 7:02pm
8
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
}
}
system
March 1, 2014, 8:04pm
11
So - Do you have a reference or link for an "IR detector"?
system
March 1, 2014, 8:10pm
13
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();
}
}
system
March 2, 2014, 5:47am
15
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?