|
|
|
|
@@ -26,7 +26,7 @@
|
|
|
|
|
// Relays:
|
|
|
|
|
#define PIT_RELEASE_PIN 37
|
|
|
|
|
#define LIGHT_PIN 39
|
|
|
|
|
#define UNUSED_RELAY3_PIN 35
|
|
|
|
|
#define LIGHT_PIN2 35
|
|
|
|
|
#define UNUSED_RELAY4_PIN 33
|
|
|
|
|
|
|
|
|
|
const byte relayOnState = LOW;
|
|
|
|
|
@@ -69,7 +69,7 @@ CountDown ReadyCountDown(CountDown::SECONDS);
|
|
|
|
|
// Rumble stopwatch
|
|
|
|
|
StopWatch rumbleTIME(StopWatch::SECONDS);
|
|
|
|
|
|
|
|
|
|
int CLOCK_LED_BRIGHTNESS = 64; // 64 is okay
|
|
|
|
|
int CLOCK_LED_BRIGHTNESS = 128; // 64 is okay
|
|
|
|
|
|
|
|
|
|
int BLINK_COUNTER_REDTEAM = 0;
|
|
|
|
|
int BLINK_COUNTER_BLUETEAM = 0;
|
|
|
|
|
@@ -85,11 +85,11 @@ bool resumeFight = false;
|
|
|
|
|
// ESP-NOW config
|
|
|
|
|
// send config, Clock:
|
|
|
|
|
// A Arena
|
|
|
|
|
//uint8_t broadcastAddressClock1[] = {0x48, 0x27, 0xE2, 0x5D, 0xB6, 0x84};
|
|
|
|
|
//uint8_t broadcastAddressClock2[] = {0xD8, 0x3B, 0xDA, 0xC8, 0x95, 0x42};
|
|
|
|
|
uint8_t broadcastAddressClock1[] = {0x48, 0x27, 0xE2, 0x5D, 0xB6, 0x84};
|
|
|
|
|
uint8_t broadcastAddressClock2[] = {0xD8, 0x3B, 0xDA, 0xC9, 0x49, 0xC6};
|
|
|
|
|
// B Arena
|
|
|
|
|
uint8_t broadcastAddressClock1[] = {0xD8, 0x3B, 0xDA, 0xC9, 0x49, 0xC6};
|
|
|
|
|
uint8_t broadcastAddressClock2[] = {0xD8, 0x3B, 0xDA, 0xC8, 0xFF, 0xFA};
|
|
|
|
|
//uint8_t broadcastAddressClock1[] = {0xD8, 0x3B, 0xDA, 0xC9, 0x49, 0xC6};
|
|
|
|
|
//uint8_t broadcastAddressClock2[] = {0xD8, 0x3B, 0xDA, 0xC8, 0xFF, 0xFA};
|
|
|
|
|
// struct for clock data
|
|
|
|
|
typedef struct struct_message_Clock {
|
|
|
|
|
int sendMinutes;
|
|
|
|
|
@@ -105,11 +105,11 @@ struct_message_Clock sendClockDATA;
|
|
|
|
|
|
|
|
|
|
// send config, pilot buttons:
|
|
|
|
|
// A Arena
|
|
|
|
|
//uint8_t broadcastAddressREDTEAMbutton[] = {0x84, 0xFC, 0xE6, 0xC7, 0x23, 0x14};
|
|
|
|
|
//uint8_t broadcastAddressBLUETEAMbutton[] = {0x84, 0xFC, 0xE6, 0xC7, 0x1A, 0x02};
|
|
|
|
|
uint8_t broadcastAddressREDTEAMbutton[] = {0x84, 0xFC, 0xE6, 0xC7, 0x23, 0x14};
|
|
|
|
|
uint8_t broadcastAddressBLUETEAMbutton[] = {0x84, 0xFC, 0xE6, 0xC7, 0x1A, 0x02};
|
|
|
|
|
// B Arena
|
|
|
|
|
uint8_t broadcastAddressREDTEAMbutton[] = {0xD8, 0x3B, 0xDA, 0xC8, 0x95, 0x58};
|
|
|
|
|
uint8_t broadcastAddressBLUETEAMbutton[] = {0xD8, 0x3B, 0xDA, 0xC8, 0x95, 0x1C};
|
|
|
|
|
//uint8_t broadcastAddressREDTEAMbutton[] = {0xD8, 0x3B, 0xDA, 0xC8, 0x95, 0x58};
|
|
|
|
|
//uint8_t broadcastAddressBLUETEAMbutton[] = {0xD8, 0x3B, 0xDA, 0xC8, 0x95, 0x1C};
|
|
|
|
|
|
|
|
|
|
// Structure for sending data
|
|
|
|
|
typedef struct struct_message_send {
|
|
|
|
|
@@ -122,9 +122,12 @@ struct_message_send sendToBLUETEAMbutton;
|
|
|
|
|
|
|
|
|
|
// ESP-Now stuff for the Pit controller
|
|
|
|
|
// A Arena
|
|
|
|
|
//uint8_t broadcastAddressPitController[] = {0x84, 0xFC, 0xE6, 0xC7, 0x19, 0xDE};
|
|
|
|
|
uint8_t broadcastAddressPitController[] = {0x84, 0xFC, 0xE6, 0xC7, 0x19, 0xDE};
|
|
|
|
|
// B Arena
|
|
|
|
|
uint8_t broadcastAddressPitController[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xB0, 0x0B};
|
|
|
|
|
//uint8_t broadcastAddressPitController[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xB0, 0x0B};
|
|
|
|
|
// Test Pit controller
|
|
|
|
|
//uint8_t broadcastAddressPitController[] = {0x94, 0xA9, 0x90, 0x0B, 0x21, 0x64};
|
|
|
|
|
|
|
|
|
|
// Structure for sending data
|
|
|
|
|
typedef struct struct_message_pit {
|
|
|
|
|
bool PIT; // LED state
|
|
|
|
|
@@ -249,13 +252,13 @@ void setup() {
|
|
|
|
|
digitalWrite(PIT_RELEASE_PIN, relayOffState);
|
|
|
|
|
pinMode(LIGHT_PIN, OUTPUT);
|
|
|
|
|
digitalWrite(LIGHT_PIN, LOW); // have it by default on, to prevent flickering, needs a better fix tho
|
|
|
|
|
pinMode(UNUSED_RELAY3_PIN, OUTPUT);
|
|
|
|
|
digitalWrite(UNUSED_RELAY3_PIN, relayOffState);
|
|
|
|
|
pinMode(LIGHT_PIN2, OUTPUT);
|
|
|
|
|
digitalWrite(LIGHT_PIN2, LOW); // have it by default on, to prevent flickering, needs a better fix tho
|
|
|
|
|
pinMode(UNUSED_RELAY4_PIN, OUTPUT);
|
|
|
|
|
digitalWrite(UNUSED_RELAY4_PIN, relayOffState);
|
|
|
|
|
// set status LED outputs:
|
|
|
|
|
pinMode(LIGHT_STATUS_LED, OUTPUT);
|
|
|
|
|
digitalWrite(LIGHT_PIN, HIGH); // have it by default on, to prevent flickering, needs a better fix tho
|
|
|
|
|
digitalWrite(LIGHT_STATUS_LED, HIGH);
|
|
|
|
|
pinMode(AUTOPIT_STATUS_LED, OUTPUT);
|
|
|
|
|
digitalWrite(AUTOPIT_STATUS_LED, LOW);
|
|
|
|
|
pinMode(MODE_STATUS_LED, OUTPUT);
|
|
|
|
|
|