Changed Clock Brightness to 128, added relay 3 to be controlled by the lightswitch

This commit is contained in:
2025-09-22 16:12:14 +02:00
parent 7c3dbfab63
commit c450cfb7c9
4 changed files with 24 additions and 19 deletions

View File

@@ -25,9 +25,11 @@ void openPITmanually() {
void arenaLIGHT() {
if (switchLIGHT.on()) {
digitalWrite(LIGHT_PIN, LOW);
digitalWrite(LIGHT_PIN2, LOW);
}
else {
digitalWrite(LIGHT_PIN, HIGH);
digitalWrite(LIGHT_PIN2, HIGH);
}
}

View File

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

View File

@@ -59,7 +59,7 @@ void setup() {
//FastLED.addLeds<WS2811Controller800Khz, LED_DATA_PIN_TIMER, GRB>(leds_TIMER, NUM_LEDS_TIMER); // GRB ordering is typical
FastLED.addLeds<WS2812B, LED_DATA_PIN_TIMER, GRB>(leds_TIMER, NUM_LEDS_TIMER); // GRB ordering is typical
//FastLED.setMaxRefreshRate(10, true);
FastLED.setMaxPowerInVoltsAndMilliamps(5,2000); // Limit to 10W of output power
FastLED.setMaxPowerInVoltsAndMilliamps(5,4000); // Limit to 20W of output power
// set default values
// default screen, just to show it's up and running but hasn't received any data, should display 00:00 in blue

View File

@@ -13,7 +13,7 @@
// 1 = Red Team Button
// 2 = Blue Team Button
const bool writeBoardID = false;
int boardID = 0;
int boardID = 1;
// Hardware connections
#define START_BTN_PIN 10
@@ -47,9 +47,9 @@ bool sendDATAvar = false;
// REPLACE WITH YOUR RECEIVER MAC Address
// A Arena
//uint8_t broadcastAddress[] = {0x84, 0xFC, 0xE6, 0xC7, 0x1A, 0x8C};
uint8_t broadcastAddress[] = {0x84, 0xFC, 0xE6, 0xC7, 0x1A, 0x8C};
// B Arena
uint8_t broadcastAddress[] = {0xD8, 0x3B, 0xDA, 0xC9, 0x0C, 0xEE};
//uint8_t broadcastAddress[] = {0xD8, 0x3B, 0xDA, 0xC9, 0x0C, 0xEE};
// Structure example to send data
// Must match the receiver structure