improving code

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2024-06-11 10:48:29 +02:00
parent 970cdd6b97
commit 509f23e343
2 changed files with 36 additions and 28 deletions
+15 -11
View File
@@ -9,8 +9,16 @@
// include the library code:
#include <SoftRS485.h>
#define ID 4
#define PROGRAM "RS485-Nano 2.0 / Sender 1.3"
// 0=Test
// 1=Arbeitszimmer
// 2=Küche
// 3=Bad
// 4=Treppenhaus
#define ID 1
#define PROGRAM "Sender"
#define VERSION "1.3"
#define REVISION "2.0"
#define BTN_INT 2 // button interrupt pin
#define Max485_RO 3 // read-output of Max485
@@ -20,15 +28,10 @@
#define TRESHOLD 1024
#define TRIGGER_LEVEL 200
// 0=Test
// 1=Arbeitszimmer
// 2=Küche
// 3=Bad
// 4=Treppenhaus
#define DEBUG
#define LOG_TO_SERIAL
//#define SEND_485
//#define LOG_TO_SERIAL
#define SEND_485
boolean raw_states[8];
boolean states[8];
@@ -56,8 +59,9 @@ void setup(){
pinMode(21,INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(BTN_INT),isr,CHANGE);
// Print a message to the LCD.
Serial.println(PROGRAM);
String s = "{nano:"+String(ID)+",hw:"+REVISION+","+PROGRAM+":"+VERSION+"}";
Serial.println(s);
send485(s.c_str());
#ifdef LOG_TO_SERIAL
Serial.println("14 15 16 17 18 19 20 21");
#endif