Skip to content

Commit

Permalink
some adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
trilu2000 committed Mar 23, 2014
1 parent 720e61c commit faed3a8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
18 changes: 17 additions & 1 deletion examples/HM_LC_SW1_BA_PCB/HM_LC_SW1_BA_PCB.ino
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ void setup() {
button[0].config(8, NULL); // configure button on specific pin and handover a function pointer to the main sketch

relay[0].regInHM(1,&hm); // register relay class in HM to respective channel
relay[0].config(0,3,0,5,5); // configure the relay to monostable, therefore only one HW pin needed
//relay[0].config(0,3,0,5,5); // configure the relay to monostable, therefore only one HW pin needed
relay[0].config(&initRelay,&switchRelay,2,2); // init function, switch function, min delay, random delay for transmitting status message

Serial << "\npair: " << pHex(regs.ch0.l0.pairCentral,3) << '\n';
}
Expand All @@ -71,6 +72,21 @@ void loop() {
}


void initRelay() {
digitalWrite(5,0);
pinMode(5,OUTPUT);
}
void switchRelay(uint8_t on) {
if (on) {
digitalWrite(5,1);

} else {
digitalWrite(5,0);

}
}


//- HM functions ----------------------------------------------------------------------------------------------------------
void HM_Status_Request(uint8_t *data, uint8_t len) {
// Serial << F("status request, data: ") << pHex(data,len) << '\n';
Expand Down
4 changes: 4 additions & 0 deletions examples/HM_LC_SW1_BA_PCB/Register.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ HM::s_devParm dParm = {
/* pointer to serial */ devParam,
};

HM::s_modtable modTbl[] = {
{0,0,(s_mod_dlgt)NULL},
{0,0,(s_mod_dlgt)NULL},
}; // 24 byte

//- ----------------------------------------------------------------------------------------------------------------------
//- channel slice definition ---------------------------------------------------------------------------------------------
Expand Down

0 comments on commit faed3a8

Please sign in to comment.