added preprocessor statements to switch out MAC Addresses at compile time
This commit is contained in:
@@ -8,6 +8,11 @@
|
|||||||
#include <CountDown.h> // https://github.com/RobTillaart/CountDown
|
#include <CountDown.h> // https://github.com/RobTillaart/CountDown
|
||||||
#include <StopWatch.h> // https://github.com/RobTillaart/StopWatch_RT
|
#include <StopWatch.h> // https://github.com/RobTillaart/StopWatch_RT
|
||||||
|
|
||||||
|
// set Arena, switches the MAC addresses out
|
||||||
|
// 1 = Arena A (Ant)
|
||||||
|
// 2 = Arena B (Beetle)
|
||||||
|
#define ARENA 1
|
||||||
|
|
||||||
// Hardware connections
|
// Hardware connections
|
||||||
// Buttons:
|
// Buttons:
|
||||||
#define START_BTN_PIN 1
|
#define START_BTN_PIN 1
|
||||||
@@ -84,12 +89,16 @@ bool resumeFight = false;
|
|||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// ESP-NOW config
|
// ESP-NOW config
|
||||||
// send config, Clock:
|
// send config, Clock:
|
||||||
|
#if ARENA == 1
|
||||||
// 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, 0xC9, 0x49, 0xC6};
|
uint8_t broadcastAddressClock2[] = {0xD8, 0x3B, 0xDA, 0xC9, 0x49, 0xC6};
|
||||||
|
#elif ARENA == 2
|
||||||
// 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};
|
||||||
|
#endif
|
||||||
|
|
||||||
// struct for clock data
|
// struct for clock data
|
||||||
typedef struct struct_message_Clock {
|
typedef struct struct_message_Clock {
|
||||||
int sendMinutes;
|
int sendMinutes;
|
||||||
@@ -104,12 +113,15 @@ typedef struct struct_message_Clock {
|
|||||||
struct_message_Clock sendClockDATA;
|
struct_message_Clock sendClockDATA;
|
||||||
|
|
||||||
// send config, pilot buttons:
|
// send config, pilot buttons:
|
||||||
|
#if ARENA == 1
|
||||||
// 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};
|
||||||
|
#elif ARENA == 2
|
||||||
// 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};
|
||||||
|
#endif
|
||||||
|
|
||||||
// Structure for sending data
|
// Structure for sending data
|
||||||
typedef struct struct_message_send {
|
typedef struct struct_message_send {
|
||||||
@@ -121,10 +133,13 @@ struct_message_send sendToREDTEAMbutton;
|
|||||||
struct_message_send sendToBLUETEAMbutton;
|
struct_message_send sendToBLUETEAMbutton;
|
||||||
|
|
||||||
// ESP-Now stuff for the Pit controller
|
// ESP-Now stuff for the Pit controller
|
||||||
|
#if ARENA == 1
|
||||||
// A Arena
|
// A Arena
|
||||||
uint8_t broadcastAddressPitController[] = {0x84, 0xFC, 0xE6, 0xC7, 0x19, 0xDE};
|
uint8_t broadcastAddressPitController[] = {0x84, 0xFC, 0xE6, 0xC7, 0x19, 0xDE};
|
||||||
|
#elif ARENA == 2
|
||||||
// B Arena
|
// B Arena
|
||||||
//uint8_t broadcastAddressPitController[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xB0, 0x0B};
|
uint8_t broadcastAddressPitController[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xB0, 0x0B};
|
||||||
|
#endif
|
||||||
// Test Pit controller
|
// Test Pit controller
|
||||||
//uint8_t broadcastAddressPitController[] = {0x94, 0xA9, 0x90, 0x0B, 0x21, 0x64};
|
//uint8_t broadcastAddressPitController[] = {0x94, 0xA9, 0x90, 0x0B, 0x21, 0x64};
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,11 @@
|
|||||||
const bool writeBoardID = false;
|
const bool writeBoardID = false;
|
||||||
int boardID = 1;
|
int boardID = 1;
|
||||||
|
|
||||||
|
// set Arena, switches the MAC addresses out
|
||||||
|
// 1 = Arena A (Ant)
|
||||||
|
// 2 = Arena B (Beetle)
|
||||||
|
#define ARENA 1
|
||||||
|
|
||||||
// Hardware connections
|
// Hardware connections
|
||||||
#define START_BTN_PIN 10
|
#define START_BTN_PIN 10
|
||||||
#define PAUSE_BTN_PIN 8
|
#define PAUSE_BTN_PIN 8
|
||||||
@@ -46,10 +51,13 @@ bool sendDATAvar = false;
|
|||||||
// ESP-NOW config
|
// ESP-NOW config
|
||||||
|
|
||||||
// REPLACE WITH YOUR RECEIVER MAC Address
|
// REPLACE WITH YOUR RECEIVER MAC Address
|
||||||
// A Arena
|
#if ARENA == 1
|
||||||
|
// A Arena Controller MAC Address
|
||||||
uint8_t broadcastAddress[] = {0x84, 0xFC, 0xE6, 0xC7, 0x1A, 0x8C};
|
uint8_t broadcastAddress[] = {0x84, 0xFC, 0xE6, 0xC7, 0x1A, 0x8C};
|
||||||
// B Arena
|
#elif ARENA == 2
|
||||||
//uint8_t broadcastAddress[] = {0xD8, 0x3B, 0xDA, 0xC9, 0x0C, 0xEE};
|
// B Arena Controller MAC Address
|
||||||
|
uint8_t broadcastAddress[] = {0xD8, 0x3B, 0xDA, 0xC9, 0x0C, 0xEE};
|
||||||
|
#endif
|
||||||
|
|
||||||
// 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