Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass
Created June 28, 2020 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffersGlass/0022785de33a09fc98922f900f6437e1 to your computer and use it in GitHub Desktop.
Save JeffersGlass/0022785de33a09fc98922f900f6437e1 to your computer and use it in GitHub Desktop.
#include <Servo.h>
#include <Conceptinetics.h>
#define DMX_SLAVE_CHANNELS 1
// Configure a DMX slave controller
DMX_Slave dmx_slave ( DMX_SLAVE_CHANNELS );
const int ledPin = 6;
void setup() {
dmx_slave.enable ();
dmx_slave.setStartAddress (2);
// Set led pin as output pin
pinMode(ledPin, OUTPUT );
analogWrite(ledPin, 0);
}
void loop()
{
// getChannelValue is relative to the configured startaddress
analogWrite(ledPin, dmx_slave.getChannelValue(1));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment