DMX Light

Product: https://www.tindie.com/products/williambailes/plex-controller/
Product: DMX Light

For years I have been looking into DMX controllers, DMX lights and MIDI controllers to see how they work and how I could make some lights/controllers my self. I have made a number of DMX controllers that sends the DMX signal to the lights but I have not made a DMX light before. This light is the first DMX light that I have made.
The controller is the PLEX controllerwhich allows easy access to a 16X2 LCD. This controller allows the setting for the light to be changed and set. The light has different modes including colour fading, colour stepping, solid colour and DMX.
The program uses the RGB LED Library that allows control of RGB LEDs and the fading between colors. the program also uses a DMX library to read the incoming DMX signal

Code for Project

GNU General Public License v3.0

#include <LiquidCrystal.h>
#include <RGB_LED.h>
#define upButtonPin A0
#define downButtonPin A1
#define modeButtonPin A2

byte mode = 1;
unsigned int speed = 1000;
byte DMX = 1;

LiquidCrystal lcd(2, 4, 5, 6, 7, 8);
RGB_LED LED(3,10,11);

void setup() 
{
  Serial.begin(9600);
  lcd.begin(16, 2);
  pinMode(upButtonPin,INPUT);
  pinMode(downButtonPin,INPUT);
  pinMode(modeButtonPin, INPUT);
  Serial.println("Start");
  changemode();
  setsetting();
}

void loop() 
{
   LED.run();
  
   if(mode ==6)
   {
     DMXcontrol();
   }

   if(digitalRead(modeButtonPin)==HIGH)
   {
      mode++;
      changemode();
      setsetting();
      controldelay(); // and mode button is low
   }
   if(digitalRead(upButtonPin)==HIGH)
   {
      upsetting();
      setsetting();
      controldelay();
   }
   if(digitalRead(downButtonPin)==HIGH)
   {
      downsetting();
      setsetting();
      controldelay();
   }
}



void changemode()
{
  lcd.setCursor(0,0);
  Serial.println(mode);
  switch(mode)
  {
    case 1:
      Serial.println("Fade");
      lcd.print("Fade");
      LED.setFunction(Fade);
    break;
    case 2:
      Serial.println("Fade Random");
      lcd.print("Fade Random");
      LED.setFunction(FadeRandom);
    break;
    case 3:
      Serial.println("Step RGB");
      lcd.print("Step RGB");
      LED.setFunction(Step1);
    break;
    case 4:
      Serial.println("Step ALL");
      lcd.print("Step ALL");
      LED.setFunction(Step2);
    break;
    case 5:
      Serial.println("Step Random");
      lcd.print("Step Random");
      LED.setFunction(StepRandom);
    break;
    case 6:
      Serial.println("DMX");
      lcd.print("DMX");
      LED.fadeToColour(Black,500);
    break;
    case 7:
      Serial.println("White");
      lcd.print("White");
      LED.fadeToColour(White,500);
    break;
    case 8:
      Serial.println("Red");
      lcd.print("Red");
      LED.fadeToColour(Red,500);
    break;
    case 9:
      Serial.println("Gre");
      lcd.print("Green");
      LED.fadeToColour(Green,500);
    break;
    case 10:
      Serial.println("Blue");
      lcd.print("Blue");
      LED.fadeToColour(Blue,500);
    break;
    default:
      mode = 1;
      changemode();
  }
  lcd.print("                ");
}

void setsetting()
{
  lcd.setCursor(0,1);
  if(mode <=5)
  {
    lcd.print("Speed: ");
    lcd.print(speed);
    LED.setSpeed(speed);
  }
  else if(mode ==6)
  {
    lcd.print("Address: ");
    lcd.print(DMX);
  }
  lcd.print("                ");
}



void upsetting()
{
  if(mode <=5 && speed < 30000)
  {
    speed = speed +100;
  }
  else if(mode ==6 && DMX < 255)
  {
    DMX++;
  }
}


void downsetting()
{
  if(mode <=5 && speed > 100)
  {
    speed = speed - 100;
  }
  else if(mode ==6 && DMX > 1)
  {
    DMX--;
  }
}



void controldelay()
{
  unsigned long currenttime = millis();
  while(currenttime+50 > millis() || digitalRead(modeButtonPin)==HIGH)
  {
    LED.run();
  }
}





void DMXcontrol()
{
  
}

Related Projects

DMX Controller Mk2

DMX Controller Mk2

This DMX controller to made to control stage/party lights through the DMX signal. This DMX signal is widely used for stage lighting systems at festival and clubs. This is the second DMX controller that I have made but works differently from the first. The First controller, 8 address in a row are selected that can be changed. 1 byte can be changed per fader. Most values in the bit steam don't …
Read more


DMX Controller

DMX Controller

This DMX controller to made to control stage/party lights through the DMX signal. This DMX signal is widely used for stage lighting systems at festival and clubs. I have some lights that I take to parties that i would want to have more control over, thankfully they use the DMX interface to control them. For a while I have been wanting to make a DMX controller to control the lights, smoke …
Read more


Latest Projects

Popular Projects