#define DEBUG 1
#define prnt Serial1.print
#define prntln Serial1.println
#define LengthOf(x)(sizeof(x)/sizeof(x[0]))
#define LITERAL(...) "" #__VA_ARGS__
/* ------------------------------------------------------- */
template<typename T>
struct Pair { const char* key; T val; };
typedef Pair<int> Pair_int;
Pair_int myInt = {"INT",41};
Pair_int myInts[2] = {
{"INT1",41},
{"INT2",42}
};
//Pair<int> myPair = {"PAIR1",42};
/*
typedef Pair<float> floatPair;
floatPair myFloat = {"FLOAT",4.2};
template <typename T>
struct Pair {
size_t x;
T *ary;
};
typedef Pair<int> iArray;
typedef Pair<float> fArray;
*/
/* ------------------------------------------------------- */
enum : int {
LEN = 13,
SOLENOID = 16, // 12V 3A Power Solenoid
RUMBLE = 17, // 3V Rumble Motor inside gun
BULBS = 18, // Dual 12v bulbs on top of gun
CLICK = 19, // Mini-solenoid inside gun
I2C_SDA = 20, // I2C SDA-pin on Pico (yellow)
I2C_SCL = 21, // I2C SCL-pin on Pico (green)
BOOT_BTN = 22, // BOOTSEL button on Pico
LED = 25, // LED_BUILTIN on Pico
TRIGGER = 26, // Gun Trigger
TILT = 27, // Mercury Switch pin
TEMP = 28 // DS18S20 Signal pin
};
/*
typedef enum : int { OFF,ON } State;
typedef enum : int { NONE, IN, OUT } Mode;
typedef struct {
const char* key;
int val;
} KeyVal;
*/
void setup() {
Serial1.begin(115200);
Serial1.println(myInt.val);
Serial1.println(myInts[1].val);
}
void loop() {
delay(1); // this speeds up the simulation
}
///////////////////////////////////////////////////////////////////////