DVDdoug:
If that’s also erratic, the 10ms delay may be too short…
Ey thanks for your feedback! It seems you are right there. I got rid of the pote and realized that something like:
dmx_master.setChannelValue (1, 255);
delay (10);
dmx_master.setChannelValue (1, 0);
delay (1000);
was also rather erratic. So I started pushing up the value until I saw that I have regularity. I am currently at 30ms
dmx_master.setChannelValue (1, 255);
delay (30);
dmx_master.setChannelValue (1, 0);
delay (1000);
Having that in mind, I put back the potentiometer and I left the shortest delay at a minimum value of 50ms. It works much better, but it is still not what I was expecting. There is still something there fucking up regularily, specially at high speeds
#include <Conceptinetics.h>
#define DMX_MASTER_CHANNELS 1
#define RXEN_PIN 2
DMX_Master dmx_master (DMX_MASTER_CHANNELS, RXEN_PIN);
int StroboDelay = 1000;
void setup() {
dmx_master.enable ();
dmx_master.setChannelRange (1,25,127);
}
void loop() {
int Pote = analogRead(A0);
StroboDelay = map(Pote, 0, 4064, 1000, 50);
dmx_master.setChannelValue (1, 255);
delay (50);
dmx_master.setChannelValue (1, 0);
delay (StroboDelay);
}
I have been reading the values from the potentiometer with serial monitor, and the values are correct. I used the following code:
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(A0);
Serial.println(sensorValue);
delay(1);
}
BUT, I cannot add the Serial.begin(9600); instruction in my strobo code, the compilation doesnt works… I suppose the shield is using Serial to send DMX?