finished mysensors

This commit is contained in:
2025-11-11 18:47:59 +01:00
parent 728873e0f2
commit 3bcfeeff7f
3 changed files with 1866 additions and 11 deletions

View File

@@ -12,6 +12,7 @@
platform = atmelavr
board = pro8MHzatmega328
framework = arduino
upload_protocol = arduino
monitor_speed = 115200
lib_deps =
mysensors/MySensors@^2.3.2
@@ -22,6 +23,7 @@ lib_deps =
platform = atmelavr
board = nanoatmega328new
framework = arduino
upload_protocol = arduino
monitor_speed = 115200
lib_deps =
mysensors/MySensors@^2.3.2

File diff suppressed because it is too large Load Diff

View File

@@ -3,20 +3,10 @@
#define MY_RADIO_RF24
#define MY_DEBUG
#define MY_DEBUG_VERBOSE_SIGNING
#define MY_SIGNING_SOFT
#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
#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
#define MY_RF24_CE_PIN 10
#define MY_RF24_CS_PIN 9
@@ -93,7 +83,7 @@ void presentation()
void setup()
{
Serial.begin(115200);
#ifdef NANO
pinMode(RLY_PIN, OUTPUT);
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));
batteryPercent = constrain(batteryPercent, 0, 100);
send(ch_comm_vcc.set(voltageV, 2));
sendBatteryLevel(batteryPercent); // función de MySensor que envía el procentaje
wait(2000);