Trying to use DmxSerial on a Nano in place of DmxSimple, but not clear which pin that DmxSerial outputs the DMX signal and how, if possible since my board is already wired from "D2" pin 5 to the MAX485 input pin 4, to programmatically change that pin.
DmxSimple had a "usePin" call to specify the output pin, but that call isn't recognized by DmxSerial, and I can't determine what the default output pin is for DmxSerial.
DmxSerial and DmxSimple are libraries that create the signal protocol for commercial DMX lighting, allowing an Arduino to function as a DMX Lighting Controller.
DmxSimple has a function to change the output pin but doesn't appear DmxSerial does. Want to try DmxSerial because my project doesn't work for some DMX lights, and DmxSerial appears to better timing capabilities. My circuit board's already hardwired for pin 5 "D2" and would rather not cut traces to change that.
I thought pins 0 and 1 are used for the serial USB connection to the PC and, if used, would prevent programming the Arduino, which, thinking about it, you wouldn't necessarily be programming it while using it!
So does anyone have some background with DmxSerial?
Having a difficult time finding info on what the default output pin is and how to use a different output pin.
hi DMX is a protocol thats bases on RS485, therefore you need a converter from RX and TX to RS485.
you can use the MAX481 or 75176.
on google you can find many pictures how to wire this.
thought pins 0 and 1 are used for the serial USB connection to the PC and, if used, would prevent programming the Arduino, which, thinking about it, you wouldn't necessarily be programming it while using it!
first unplug your circuit board's from the arduino then programm it and put it back on again.
#include <DMXSerial.h>
void setup() {
DMXSerial.init(DMXController);
/* Do init stuff here, runs once per reset or power cycle */
Serial.begin(9600); // Initialize the connection to Serial Monitor
randomSeed(analogRead(0)); // Pick a random seed
pinMode(13, OUTPUT);
// Digital inputs need definition here (already have a hardware pullup).
pinMode(2, INPUT);
pinMode(3, INPUT);
// DMX output to Tx pin 1 by default for DmxSerial, define maximum number of DMX channels used
DMXSerial.maxChannel(36); // Highest DMX channel
} // end setup
and I don't understand the error messages...
C:\Users\rick\AppData\Local\Temp\build3950328564753168963.tmp/core.a(HardwareSerial0.cpp.o): In function __vector_18': C:\Rick\Arduino\Arduino_1_6_4\arduino-1.6.4-windows\arduino-1.6.4\hardware\arduino\avr\cores\arduino/HardwareSerial0.cpp:48: multiple definition of __vector_18'
DMXSerial\DMXSerial.cpp.o:C:\Rick\Arduino\Arduino_1_6_4\arduino-1.6.4-windows\arduino-1.6.4\libraries\DMXSerial-master\src/DMXSerial.cpp:407: first defined here
C:\Users\rick\AppData\Local\Temp\build3950328564753168963.tmp/core.a(HardwareSerial0.cpp.o): In function __vector_18': C:\Rick\Arduino\Arduino_1_6_4\arduino-1.6.4-windows\arduino-1.6.4\hardware\arduino\avr\cores\arduino/HardwareSerial0.cpp:48: multiple definition of __vector_19'
DMXSerial\DMXSerial.cpp.o:C:\Rick\Arduino\Arduino_1_6_4\arduino-1.6.4-windows\arduino-1.6.4\libraries\DMXSerial-master\src/DMXSerial.cpp:296: first defined here
collect2.exe: error: ld returned 1 exit status
Error compiling.
So if both are trying to use the same interrupt, can the interrupt for one be changed? Would still want to have the diagnostic printing capability so would need Serial.begin() to set up the Serial Monitor.