Changed Clock Brightness to 128, added relay 3 to be controlled by the lightswitch
This commit is contained in:
@@ -25,9 +25,11 @@ void openPITmanually() {
|
|||||||
void arenaLIGHT() {
|
void arenaLIGHT() {
|
||||||
if (switchLIGHT.on()) {
|
if (switchLIGHT.on()) {
|
||||||
digitalWrite(LIGHT_PIN, LOW);
|
digitalWrite(LIGHT_PIN, LOW);
|
||||||
|
digitalWrite(LIGHT_PIN2, LOW);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
digitalWrite(LIGHT_PIN, HIGH);
|
digitalWrite(LIGHT_PIN, HIGH);
|
||||||
|
digitalWrite(LIGHT_PIN2, HIGH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
// Relays:
|
// Relays:
|
||||||
#define PIT_RELEASE_PIN 37
|
#define PIT_RELEASE_PIN 37
|
||||||
#define LIGHT_PIN 39
|
#define LIGHT_PIN 39
|
||||||
#define UNUSED_RELAY3_PIN 35
|
#define LIGHT_PIN2 35
|
||||||
#define UNUSED_RELAY4_PIN 33
|
#define UNUSED_RELAY4_PIN 33
|
||||||
|
|
||||||
const byte relayOnState = LOW;
|
const byte relayOnState = LOW;
|
||||||
@@ -69,7 +69,7 @@ CountDown ReadyCountDown(CountDown::SECONDS);
|
|||||||
// Rumble stopwatch
|
// Rumble stopwatch
|
||||||
StopWatch rumbleTIME(StopWatch::SECONDS);
|
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_REDTEAM = 0;
|
||||||
int BLINK_COUNTER_BLUETEAM = 0;
|
int BLINK_COUNTER_BLUETEAM = 0;
|
||||||
@@ -85,11 +85,11 @@ bool resumeFight = false;
|
|||||||
// ESP-NOW config
|
// ESP-NOW config
|
||||||
// send config, Clock:
|
// send config, Clock:
|
||||||
// A Arena
|
// A Arena
|
||||||
//uint8_t broadcastAddressClock1[] = {0x48, 0x27, 0xE2, 0x5D, 0xB6, 0x84};
|
uint8_t broadcastAddressClock1[] = {0x48, 0x27, 0xE2, 0x5D, 0xB6, 0x84};
|
||||||
//uint8_t broadcastAddressClock2[] = {0xD8, 0x3B, 0xDA, 0xC8, 0x95, 0x42};
|
uint8_t broadcastAddressClock2[] = {0xD8, 0x3B, 0xDA, 0xC9, 0x49, 0xC6};
|
||||||
// B Arena
|
// B Arena
|
||||||
uint8_t broadcastAddressClock1[] = {0xD8, 0x3B, 0xDA, 0xC9, 0x49, 0xC6};
|
//uint8_t broadcastAddressClock1[] = {0xD8, 0x3B, 0xDA, 0xC9, 0x49, 0xC6};
|
||||||
uint8_t broadcastAddressClock2[] = {0xD8, 0x3B, 0xDA, 0xC8, 0xFF, 0xFA};
|
//uint8_t broadcastAddressClock2[] = {0xD8, 0x3B, 0xDA, 0xC8, 0xFF, 0xFA};
|
||||||
// struct for clock data
|
// struct for clock data
|
||||||
typedef struct struct_message_Clock {
|
typedef struct struct_message_Clock {
|
||||||
int sendMinutes;
|
int sendMinutes;
|
||||||
@@ -105,11 +105,11 @@ struct_message_Clock sendClockDATA;
|
|||||||
|
|
||||||
// send config, pilot buttons:
|
// send config, pilot buttons:
|
||||||
// A Arena
|
// A Arena
|
||||||
//uint8_t broadcastAddressREDTEAMbutton[] = {0x84, 0xFC, 0xE6, 0xC7, 0x23, 0x14};
|
uint8_t broadcastAddressREDTEAMbutton[] = {0x84, 0xFC, 0xE6, 0xC7, 0x23, 0x14};
|
||||||
//uint8_t broadcastAddressBLUETEAMbutton[] = {0x84, 0xFC, 0xE6, 0xC7, 0x1A, 0x02};
|
uint8_t broadcastAddressBLUETEAMbutton[] = {0x84, 0xFC, 0xE6, 0xC7, 0x1A, 0x02};
|
||||||
// B Arena
|
// B Arena
|
||||||
uint8_t broadcastAddressREDTEAMbutton[] = {0xD8, 0x3B, 0xDA, 0xC8, 0x95, 0x58};
|
//uint8_t broadcastAddressREDTEAMbutton[] = {0xD8, 0x3B, 0xDA, 0xC8, 0x95, 0x58};
|
||||||
uint8_t broadcastAddressBLUETEAMbutton[] = {0xD8, 0x3B, 0xDA, 0xC8, 0x95, 0x1C};
|
//uint8_t broadcastAddressBLUETEAMbutton[] = {0xD8, 0x3B, 0xDA, 0xC8, 0x95, 0x1C};
|
||||||
|
|
||||||
// Structure for sending data
|
// Structure for sending data
|
||||||
typedef struct struct_message_send {
|
typedef struct struct_message_send {
|
||||||
@@ -122,9 +122,12 @@ struct_message_send sendToBLUETEAMbutton;
|
|||||||
|
|
||||||
// ESP-Now stuff for the Pit controller
|
// ESP-Now stuff for the Pit controller
|
||||||
// A Arena
|
// A Arena
|
||||||
//uint8_t broadcastAddressPitController[] = {0x84, 0xFC, 0xE6, 0xC7, 0x19, 0xDE};
|
uint8_t broadcastAddressPitController[] = {0x84, 0xFC, 0xE6, 0xC7, 0x19, 0xDE};
|
||||||
// B Arena
|
// 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
|
// Structure for sending data
|
||||||
typedef struct struct_message_pit {
|
typedef struct struct_message_pit {
|
||||||
bool PIT; // LED state
|
bool PIT; // LED state
|
||||||
@@ -249,13 +252,13 @@ void setup() {
|
|||||||
digitalWrite(PIT_RELEASE_PIN, relayOffState);
|
digitalWrite(PIT_RELEASE_PIN, relayOffState);
|
||||||
pinMode(LIGHT_PIN, OUTPUT);
|
pinMode(LIGHT_PIN, OUTPUT);
|
||||||
digitalWrite(LIGHT_PIN, LOW); // have it by default on, to prevent flickering, needs a better fix tho
|
digitalWrite(LIGHT_PIN, LOW); // have it by default on, to prevent flickering, needs a better fix tho
|
||||||
pinMode(UNUSED_RELAY3_PIN, OUTPUT);
|
pinMode(LIGHT_PIN2, OUTPUT);
|
||||||
digitalWrite(UNUSED_RELAY3_PIN, relayOffState);
|
digitalWrite(LIGHT_PIN2, LOW); // have it by default on, to prevent flickering, needs a better fix tho
|
||||||
pinMode(UNUSED_RELAY4_PIN, OUTPUT);
|
pinMode(UNUSED_RELAY4_PIN, OUTPUT);
|
||||||
digitalWrite(UNUSED_RELAY4_PIN, relayOffState);
|
digitalWrite(UNUSED_RELAY4_PIN, relayOffState);
|
||||||
// set status LED outputs:
|
// set status LED outputs:
|
||||||
pinMode(LIGHT_STATUS_LED, OUTPUT);
|
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);
|
pinMode(AUTOPIT_STATUS_LED, OUTPUT);
|
||||||
digitalWrite(AUTOPIT_STATUS_LED, LOW);
|
digitalWrite(AUTOPIT_STATUS_LED, LOW);
|
||||||
pinMode(MODE_STATUS_LED, OUTPUT);
|
pinMode(MODE_STATUS_LED, OUTPUT);
|
||||||
|
|||||||
@@ -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<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.addLeds<WS2812B, LED_DATA_PIN_TIMER, GRB>(leds_TIMER, NUM_LEDS_TIMER); // GRB ordering is typical
|
||||||
//FastLED.setMaxRefreshRate(10, true);
|
//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
|
// 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
|
// default screen, just to show it's up and running but hasn't received any data, should display 00:00 in blue
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
// 1 = Red Team Button
|
// 1 = Red Team Button
|
||||||
// 2 = Blue Team Button
|
// 2 = Blue Team Button
|
||||||
const bool writeBoardID = false;
|
const bool writeBoardID = false;
|
||||||
int boardID = 0;
|
int boardID = 1;
|
||||||
|
|
||||||
// Hardware connections
|
// Hardware connections
|
||||||
#define START_BTN_PIN 10
|
#define START_BTN_PIN 10
|
||||||
@@ -47,9 +47,9 @@ bool sendDATAvar = false;
|
|||||||
|
|
||||||
// REPLACE WITH YOUR RECEIVER MAC Address
|
// REPLACE WITH YOUR RECEIVER MAC Address
|
||||||
// A Arena
|
// A Arena
|
||||||
//uint8_t broadcastAddress[] = {0x84, 0xFC, 0xE6, 0xC7, 0x1A, 0x8C};
|
uint8_t broadcastAddress[] = {0x84, 0xFC, 0xE6, 0xC7, 0x1A, 0x8C};
|
||||||
// B Arena
|
// 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
|
// Structure example to send data
|
||||||
// Must match the receiver structure
|
// Must match the receiver structure
|
||||||
|
|||||||
Reference in New Issue
Block a user