Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
// DMX Bridge
//
// Write messages in the form of "2:127\n" to forward
// thethem to the connect DMX device.

#include <DmxSimple.h>

void setup() {
  Serial.begin(9600);
  DmxSimple.usePin(11);
}

void loop() {
  if(Serial.available() > 0) {
    int channel = Serial.readStringUntil(':').toInt();
    int value = Serial.readStringUntil('\n').toInt();

    Serial.print("set ");
    Serial.print(channel);
    Serial.print(" to ");
    Serial.println(value);
  
    DmxSimple.write(channel, value);
  }
}

...