This commit is contained in:
Thomas
2022-01-24 22:33:43 +01:00
parent b2a9bd03cd
commit 570836b378
2 changed files with 28 additions and 16 deletions

View File

@@ -27,18 +27,18 @@ ATEMstd AtemSwitcher;
#define WLAN_SSID "atem" #define WLAN_SSID "atem"
#define WLAN_PASS "tuxiatem" #define WLAN_PASS "tuxiatem"
String newHostname = "CamTally_4"; char newHostname[12];
// LED PIN DEFINE // LED PIN DEFINE
#define LED_BUILTIN D4 #define LED_BUILTIN D4
#define ledPin1 D1 #define ledPin1 D1
#define ledPin2 D2 #define ledPin2 D2
int cameraNumber = 4; //CAMARA DEFINE
#define ABIT0 D5 // Bit 0 of ID
#define ABIT1 D6 // Bit 1 of ID
//int LED_BUILTIN = 2; int8_t cameraNumber = 4;
//int ledPin1 = 4;
//int ledPin2 = 5;
int PreviewTallyPrevious = 1; int PreviewTallyPrevious = 1;
int ProgramTallyPrevious = 1; int ProgramTallyPrevious = 1;
@@ -48,6 +48,18 @@ void setup() {
Serial.begin(9600); Serial.begin(9600);
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
// Set up address pins
pinMode( ABIT0, INPUT_PULLUP ); // Has a value of 1
pinMode( ABIT1, INPUT_PULLUP ); // Has a value of 2
cameraNumber = 0;
if (digitalRead( ABIT0 )) cameraNumber = 1;
if (digitalRead( ABIT1 )) cameraNumber += 2;
cameraNumber += 1;
sprintf(&newHostname[0], "CamTally_%d\n", cameraNumber);
pinMode(ledPin1, OUTPUT); // LED: 1 is on Program (Tally) pinMode(ledPin1, OUTPUT); // LED: 1 is on Program (Tally)
pinMode(ledPin2, OUTPUT); // LED: 2 is on Preview (Tally) pinMode(ledPin2, OUTPUT); // LED: 2 is on Preview (Tally)
pinMode(LED_BUILTIN, OUTPUT); // LED: Status online pinMode(LED_BUILTIN, OUTPUT); // LED: Status online
@@ -58,7 +70,7 @@ void setup() {
Serial.print(F("Connecting to ")); Serial.print(F("Connecting to "));
Serial.println(WLAN_SSID); Serial.println(WLAN_SSID);
WiFi.hostname(newHostname.c_str()); //Set new hostname WiFi.hostname(newHostname); //Set new hostname
Serial.printf("New hostname: %s\n", WiFi.hostname().c_str()); //Get Current Hostname Serial.printf("New hostname: %s\n", WiFi.hostname().c_str()); //Get Current Hostname
WiFi.begin(WLAN_SSID, WLAN_PASS); WiFi.begin(WLAN_SSID, WLAN_PASS);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 91 KiB