finished mysensors
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
platform = atmelavr
|
platform = atmelavr
|
||||||
board = pro8MHzatmega328
|
board = pro8MHzatmega328
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
upload_protocol = arduino
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
lib_deps =
|
lib_deps =
|
||||||
mysensors/MySensors@^2.3.2
|
mysensors/MySensors@^2.3.2
|
||||||
@@ -22,6 +23,7 @@ lib_deps =
|
|||||||
platform = atmelavr
|
platform = atmelavr
|
||||||
board = nanoatmega328new
|
board = nanoatmega328new
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
upload_protocol = arduino
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
lib_deps =
|
lib_deps =
|
||||||
mysensors/MySensors@^2.3.2
|
mysensors/MySensors@^2.3.2
|
||||||
|
|||||||
1862
src/SecurityPersonalizer.ino.txt
Normal file
1862
src/SecurityPersonalizer.ino.txt
Normal file
File diff suppressed because it is too large
Load Diff
13
src/main.cpp
13
src/main.cpp
@@ -3,20 +3,10 @@
|
|||||||
#define MY_RADIO_RF24
|
#define MY_RADIO_RF24
|
||||||
#define MY_DEBUG
|
#define MY_DEBUG
|
||||||
#define MY_DEBUG_VERBOSE_SIGNING
|
#define MY_DEBUG_VERBOSE_SIGNING
|
||||||
|
|
||||||
#define MY_SIGNING_SOFT
|
#define MY_SIGNING_SOFT
|
||||||
#define MY_SIGNING_REQUEST_SIGNATURES
|
#define MY_SIGNING_REQUEST_SIGNATURES
|
||||||
#define MY_HMAC_KEY 0XB5, 0XEA, 0X6C, 0X1D, 0X84, 0X59, 0XC4, 0XAC, 0X01, 0XD2, 0X22, 0XCE, 0XD2, 0XD3, 0X28, 0X54, 0X32, 0X78, 0X76, 0XD3, 0X7E, 0XF7, 0X36, 0XDF, 0XBF, 0XD5, 0X27, 0X26, 0X43, 0X86, 0X11, 0X03
|
|
||||||
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
|
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
|
||||||
|
|
||||||
#ifdef NANO
|
|
||||||
#define MY_SOFT_SERIAL 0XFD,0XEF,0X41,0XD4,0X2A,0XAA,0X5F,0X08,0XE4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PRO_MINI
|
|
||||||
#define MY_SOFT_SERIAL 0X8D,0X38,0X40,0X44,0X96,0XCD,0XC5,0X5B,0X3A
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NANO
|
#ifdef NANO
|
||||||
#define MY_RF24_CE_PIN 10
|
#define MY_RF24_CE_PIN 10
|
||||||
#define MY_RF24_CS_PIN 9
|
#define MY_RF24_CS_PIN 9
|
||||||
@@ -93,7 +83,7 @@ void presentation()
|
|||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
|
||||||
#ifdef NANO
|
#ifdef NANO
|
||||||
pinMode(RLY_PIN, OUTPUT);
|
pinMode(RLY_PIN, OUTPUT);
|
||||||
pinMode(SW1_PIN, INPUT_PULLUP); // siempre a HIGH a menos que se pulse
|
pinMode(SW1_PIN, INPUT_PULLUP); // siempre a HIGH a menos que se pulse
|
||||||
@@ -146,6 +136,7 @@ void loop()
|
|||||||
int batteryPercent = static_cast<int>(100.0 * (voltageV - VccMin) / (VccMax - VccMin));
|
int batteryPercent = static_cast<int>(100.0 * (voltageV - VccMin) / (VccMax - VccMin));
|
||||||
batteryPercent = constrain(batteryPercent, 0, 100);
|
batteryPercent = constrain(batteryPercent, 0, 100);
|
||||||
|
|
||||||
|
send(ch_comm_vcc.set(voltageV, 2));
|
||||||
sendBatteryLevel(batteryPercent); // función de MySensor que envía el procentaje
|
sendBatteryLevel(batteryPercent); // función de MySensor que envía el procentaje
|
||||||
|
|
||||||
wait(2000);
|
wait(2000);
|
||||||
|
|||||||
Reference in New Issue
Block a user