receive ATEM tallylights
parent
b1be49443b
commit
8b974057e4
@ -0,0 +1,45 @@
|
|||||||
|
#include <SPI.h>
|
||||||
|
#include <UIPEthernet.h>
|
||||||
|
#include <UIP_ATEM.h>
|
||||||
|
|
||||||
|
//Ethernet
|
||||||
|
byte mac[] = {0xAA, 0xDD, 0xBB, 0x10, 0x01, 0x01};
|
||||||
|
IPAddress ip(192, 168, 0, 20);
|
||||||
|
|
||||||
|
//IP of the ATEM switcher
|
||||||
|
ATEM AtemSwitcher(IPAddress(192, 168, 0, 50), 56417);
|
||||||
|
|
||||||
|
//tally LEDs
|
||||||
|
const int tallyLED[] = {2,3};
|
||||||
|
const int tallyLEDlength = 2;
|
||||||
|
|
||||||
|
//define min interval to send data
|
||||||
|
unsigned long currentTime = millis();
|
||||||
|
unsigned long previousTime = 0;
|
||||||
|
const long intervalTime = 1000;
|
||||||
|
|
||||||
|
void setup(){
|
||||||
|
for (int i=0; i < tallyLEDlength; i++){
|
||||||
|
pinMode(tallyLED[i], OUTPUT);
|
||||||
|
digitalWrite(tallyLED[i], LOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
//start Ethernet
|
||||||
|
Ethernet.begin(mac,ip);
|
||||||
|
|
||||||
|
Serial.begin(9600);
|
||||||
|
|
||||||
|
//connect to the switcher
|
||||||
|
AtemSwitcher.serialOutput(true);
|
||||||
|
AtemSwitcher.connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop(){
|
||||||
|
//check for new packets
|
||||||
|
AtemSwitcher.runLoop();
|
||||||
|
|
||||||
|
//write tally LEDs
|
||||||
|
for (int i=0; i < tallyLEDlength; i++){
|
||||||
|
digitalWrite(tallyLED[i], !AtemSwitcher.getProgramTally(i+1));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
Subproject commit d4cde7879ad4b54ff08491950a2f7c96f61c363e
|
Loading…
Reference in New Issue