Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include "DMXSerial.h"
int startCh = 0;//DMXのスタートアドレス
void setup()
{
DMXSerial.init(DMXReceiver);
pinMode(13, OUTPUT);
}
void loop()
{
unsigned long lastPacket = DMXSerial.noDataSince();
if (lastPacket < 5000) {
byte dmx[4];
for (int i = 0;i < 4;i++)
dmx[i] = DMXSerial.read(startCh + i);
if(dmx[1] >= 127){
digitalWrite(13, HIGH);
}else{
digitalWrite(13, LOW);
}
}
}
@magcho

This comment has been minimized.

Show comment
Hide comment
@magcho
Owner

magcho commented Jan 4, 2018

dmx recever_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment