Skip to content

Commit

Permalink
now the wplug prototype works is not very stable yet..but works
Browse files Browse the repository at this point in the history
  • Loading branch information
marco committed Nov 20, 2016
1 parent 2e9aae4 commit 0ebcafa
Show file tree
Hide file tree
Showing 5 changed files with 1,886 additions and 11 deletions.
18 changes: 10 additions & 8 deletions arduino_code/onos_plug_node_WPlugavx/onos_plug_node_wplugavx.ino
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
//#define FREQUENCY RF69_868MHZ
#define FREQUENCY RF69_433MHZ
#define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!
#define IS_RFM69HCW false // set to 'true' if you are using an RFM69HCW module
#define IS_RFM69HCW true // set to 'true' if you are using an RFM69HCW module

//*********************************************************************************************
#define SERIAL_BAUD 115200
Expand Down Expand Up @@ -159,11 +159,12 @@ char main_obj_state=0;
//int old_main_obj_state=5;


int relay1_set_pin=5;
int relay1_reset_pin=6;
int relay2_set_pin=7;
int relay2_reset_pin=8;
int obj_button_pin=4;
int relay1_set_pin=6;
int relay1_reset_pin=5;
int relay2_set_pin=8;
int relay2_reset_pin=7;
int obj_button_pin=3;
int obj_led_pin=4;



Expand Down Expand Up @@ -203,6 +204,7 @@ void changeObjStatus(char obj_number,int status_to_set){
digitalWrite(relay2_set_pin,0);
digitalWrite(relay2_reset_pin,0);
main_obj_state=status_to_set;
digitalWrite(obj_led_pin,status_to_set);
}


Expand Down Expand Up @@ -660,7 +662,7 @@ void setup() {
pinMode(relay2_set_pin, OUTPUT);
pinMode(relay2_reset_pin, OUTPUT);
pinMode(obj_button_pin, INPUT);

pinMode(obj_led_pin, OUTPUT);

//while (!Serial); // wait until serial console is open, remove if not tethered to computer
Serial.begin(SERIAL_BAUD);
Expand Down Expand Up @@ -716,7 +718,7 @@ void loop() {
changeObjStatus(main_obj_selected,!main_obj_state); // this will make a not of current state
sendSyncMessage();
while (digitalRead(obj_button_pin)==0){ //wait for button release
delay(1);
delay(100);
}

}
Expand Down
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ versione4.53 iniziato ad usare pythonserial come libraria dopo test fatti con
started working on wplug..
wireless plug protocol almost done,I can control the devboard from webinterface..
the node now can update the webinterface with the current main obj status!

now the wplug prototype works!is not very stable yet..but works


(110, 'Connection timed out');;;
Expand Down

0 comments on commit 0ebcafa

Please sign in to comment.