Tweak GarageMote
This commit is contained in:
parent
d5ca965e78
commit
b5e9bc8ad6
|
|
@ -23,11 +23,15 @@
|
||||||
//*****************************************************************************************************************************
|
//*****************************************************************************************************************************
|
||||||
// ADJUST THE SETTINGS BELOW DEPENDING ON YOUR HARDWARE/SITUATION!
|
// ADJUST THE SETTINGS BELOW DEPENDING ON YOUR HARDWARE/SITUATION!
|
||||||
//*****************************************************************************************************************************
|
//*****************************************************************************************************************************
|
||||||
#define GATEWAYID 1
|
#define GATEWAYID 1
|
||||||
#define NODEID 99
|
#define NODEID 99
|
||||||
#define NETWORKID 100
|
#define NETWORKID 100
|
||||||
#define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
|
//Match frequency to the hardware version of the radio on your Moteino (uncomment one):
|
||||||
#define KEY "thisIsEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less!
|
//#define FREQUENCY RF69_433MHZ
|
||||||
|
//#define FREQUENCY RF69_868MHZ
|
||||||
|
#define FREQUENCY RF69_915MHZ
|
||||||
|
#define ENCRYPTKEY "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less!
|
||||||
|
//#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W!
|
||||||
|
|
||||||
#define HALLSENSOR1 A0
|
#define HALLSENSOR1 A0
|
||||||
#define HALLSENSOR1_EN 4
|
#define HALLSENSOR1_EN 4
|
||||||
|
|
@ -87,8 +91,10 @@ void setup(void)
|
||||||
pinMode(LED, OUTPUT);
|
pinMode(LED, OUTPUT);
|
||||||
|
|
||||||
radio.initialize(FREQUENCY,NODEID,NETWORKID);
|
radio.initialize(FREQUENCY,NODEID,NETWORKID);
|
||||||
radio.setHighPower(); //must uncomment only for RFM69HW!
|
#ifdef IS_RFM69HW
|
||||||
radio.encrypt(KEY);
|
radio.setHighPower(); //must include only for RFM69HW!
|
||||||
|
#endif
|
||||||
|
radio.encrypt(ENCRYPTKEY);
|
||||||
|
|
||||||
char buff[50];
|
char buff[50];
|
||||||
sprintf(buff, "GarageMote : %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
|
sprintf(buff, "GarageMote : %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,12 @@
|
||||||
#define NODEID 1
|
#define NODEID 1
|
||||||
#define GARAGENODEID 99
|
#define GARAGENODEID 99
|
||||||
#define NETWORKID 100
|
#define NETWORKID 100
|
||||||
#define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
|
//Match frequency to the hardware version of the radio on your Moteino (uncomment one):
|
||||||
#define KEY "thisIsEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less!
|
//#define FREQUENCY RF69_433MHZ
|
||||||
|
//#define FREQUENCY RF69_868MHZ
|
||||||
|
#define FREQUENCY RF69_915MHZ
|
||||||
|
#define ENCRYPTKEY "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less!
|
||||||
|
//#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W!
|
||||||
#define LED 9
|
#define LED 9
|
||||||
#define SERIAL_BAUD 115200
|
#define SERIAL_BAUD 115200
|
||||||
#define ACK_TIME 30 // # of ms to wait for an ack
|
#define ACK_TIME 30 // # of ms to wait for an ack
|
||||||
|
|
@ -35,8 +39,10 @@ void setup() {
|
||||||
Serial.begin(SERIAL_BAUD);
|
Serial.begin(SERIAL_BAUD);
|
||||||
delay(10);
|
delay(10);
|
||||||
radio.initialize(FREQUENCY,NODEID,NETWORKID);
|
radio.initialize(FREQUENCY,NODEID,NETWORKID);
|
||||||
//radio.setHighPower(); //must uncomment only for RFM69HW!
|
#ifdef IS_RFM69HW
|
||||||
radio.encrypt(KEY);
|
radio.setHighPower(); //must include only for RFM69HW!
|
||||||
|
#endif
|
||||||
|
radio.encrypt(ENCRYPTKEY);
|
||||||
char buff[50];
|
char buff[50];
|
||||||
sprintf(buff, "\nListening at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
|
sprintf(buff, "\nListening at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
|
||||||
Serial.println(buff);
|
Serial.println(buff);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue