Hi there,
I'm using Arduino Mega2560, IR sensor 1838 (working fine), and some DMX lights (working fine) on port27.
May you tell me please why when I uncomment line 24 IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN); lights DOESN'T works and when I comment that line lights works as expected ?.
I read about timer handling IR and NeoPixel…and I suppose DmxSimple goes through same way.
I use frequently this kind of DMX lights but now I need to control effects using a IR remote control. I’m very confortable using DmxSimple library…so I must keep using it.
TIA !
#define DECODE_NEC
#include <Arduino.h>
#include <Wire.h> // Start the I2C interface
#include <DmxSimple.h>
#include "PinDefinitionsAndMore.h"
#include <IRremote.h>
const int z_chan1 = 27;
const int lights_uni1 = 10; // amount of lights in universe #1
const int REDRED = 1;
const int GREENGREEN = 2;
const int BLUEBLUE = 3;
int brightness;
int channels;
int y;
unsigned long time_now = 0;
void setup() {
Serial.begin(9600);
// Start the receiver, enable feedback LED and take LED feedback pin from the internal boards definition
// IR_RECEIVE_PIN = pin2
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN);
}
void loop() {
// RED UNI #1
DmxSimple.usePin(z_chan1);
for (y = 0; y <= lights_uni13; y = y+3){ // lights go 0% brightness
DmxSimple.write(REDRED+y, 0);
DmxSimple.write(GREENGREEN+y, 0);
DmxSimple.write(BLUEBLUE+y, 0);
}
time_now = millis();
while (millis() < time_now + 500) {
}
for (y = 0; y <= lights_uni13; y = y+3){
DmxSimple.write(REDRED+y, 255); // lights go 100% brightness
}
time_now = millis();
while (millis() < time_now + 500) {
}
// GREEN UNI #1
DmxSimple.usePin(z_chan1);
for (y = 0; y <= lights_uni13; y = y+3){ // lights go 0% brightness
DmxSimple.write(REDRED+y, 0);
DmxSimple.write(GREENGREEN+y, 0);
DmxSimple.write(BLUEBLUE+y, 0);
}
time_now = millis();
while (millis() < time_now + 500) {
}
for (y = 0; y <= lights_uni13; y = y+3){
DmxSimple.write(GREENGREEN+y, 255); // lights go 100% brightness
}
time_now = millis();
while (millis() < time_now + 500) {
}
// BLUE UNI #1
DmxSimple.usePin(z_chan1);
for (y = 0; y <= lights_uni13; y = y+3){ // lights go 0% brightness
DmxSimple.write(REDRED+y, 0);
DmxSimple.write(GREENGREEN+y, 0);
DmxSimple.write(BLUEBLUE+y, 0);
}
time_now = millis();
while (millis() < time_now + 500) {
}
for (y = 0; y <= lights_uni13; y = y+3){
DmxSimple.write(BLUEBLUE+y, 255); // lights go 100% brightness
}
time_now = millis();
while (millis() < time_now + 500) {
}
}