@@ -64,6 +64,9 @@ void _begin() {
|
||||
hwInit();
|
||||
#endif
|
||||
|
||||
// Call before() in sketch (if it exists)
|
||||
if (before) before();
|
||||
|
||||
debug(PSTR("Starting " MY_NODE_TYPE " (" MY_CAPABILIIES ", " LIBRARY_VERSION ")\n"));
|
||||
|
||||
signerInit();
|
||||
|
||||
@@ -236,6 +236,7 @@ extern MyMessage _msgTmp; // Buffer for temporary messages (acks and nonces amo
|
||||
void receive(const MyMessage &message) __attribute__((weak));
|
||||
void receiveTime(unsigned long) __attribute__((weak));
|
||||
void presentation() __attribute__((weak));
|
||||
void before() __attribute__((weak));
|
||||
void setup() __attribute__((weak));
|
||||
void loop() __attribute__((weak));
|
||||
|
||||
|
||||
@@ -46,8 +46,7 @@
|
||||
#define RELAY_OFF 0 // GPIO value to write to turn off attached relay
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
void before() {
|
||||
for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) {
|
||||
// Then set relay pins in output mode
|
||||
pinMode(pin, OUTPUT);
|
||||
@@ -56,6 +55,10 @@ void setup()
|
||||
}
|
||||
}
|
||||
|
||||
void setup() {
|
||||
|
||||
}
|
||||
|
||||
void presentation()
|
||||
{
|
||||
// Send the sketch version information to the gateway and Controller
|
||||
|
||||
@@ -21,6 +21,7 @@ wait KEYWORD2
|
||||
receive KEYWORD2
|
||||
receiveTime KEYWORD2
|
||||
loop KEYWORD2
|
||||
before KEYWORD2
|
||||
setup KEYWORD2
|
||||
presentation KEYWORD2
|
||||
sleep KEYWORD2
|
||||
|
||||
Reference in New Issue
Block a user