receive ATEM tallylights

This commit is contained in:
adb 2020-11-19 21:45:28 +01:00
parent b1be49443b
commit 8b974057e4
2 changed files with 46 additions and 0 deletions

45
ATEMtoNRF/ATEMtoNRF.ino Normal file
View File

@ -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));
}
}

1
librarys/UIP_ATEM Submodule

@ -0,0 +1 @@
Subproject commit d4cde7879ad4b54ff08491950a2f7c96f61c363e