Browse Source

improved voltage level for triggering

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
nano-5
Stephan Richter 5 months ago
parent
commit
970cdd6b97
  1. 23
      Software/Sender/Sender.ino

23
Software/Sender/Sender.ino

@ -9,7 +9,8 @@
// include the library code: // include the library code:
#include <SoftRS485.h> #include <SoftRS485.h>
#define PROGRAM "RS485-Nano 2.0 / Sender 1.2" #define ID 4
#define PROGRAM "RS485-Nano 2.0 / Sender 1.3"
#define BTN_INT 2 // button interrupt pin #define BTN_INT 2 // button interrupt pin
#define Max485_RO 3 // read-output of Max485 #define Max485_RO 3 // read-output of Max485
@ -18,7 +19,7 @@
#define Max485_DI 8 // data input of Max485 #define Max485_DI 8 // data input of Max485
#define TRESHOLD 1024 #define TRESHOLD 1024
#define ID 4 #define TRIGGER_LEVEL 200
// 0=Test // 0=Test
// 1=Arbeitszimmer // 1=Arbeitszimmer
// 2=Küche // 2=Küche
@ -63,15 +64,15 @@ void setup(){
} }
void isr(){ void isr(){
raw_states[0] = analogRead(14)<400; raw_states[0] = analogRead(14)<TRIGGER_LEVEL;
raw_states[1] = analogRead(15)<400; raw_states[1] = analogRead(15)<TRIGGER_LEVEL;
raw_states[2] = analogRead(16)<400; raw_states[2] = analogRead(16)<TRIGGER_LEVEL;
raw_states[3] = analogRead(17)<400; raw_states[3] = analogRead(17)<TRIGGER_LEVEL;
raw_states[4] = analogRead(18)<400; raw_states[4] = analogRead(18)<TRIGGER_LEVEL;
raw_states[5] = analogRead(19)<400; raw_states[5] = analogRead(19)<TRIGGER_LEVEL;
raw_states[6] = analogRead(20)<400; raw_states[6] = analogRead(20)<TRIGGER_LEVEL;
raw_states[7] = analogRead(21)<400; raw_states[7] = analogRead(21)<TRIGGER_LEVEL;
#ifdef LOG_TO_SERIAL #ifdef LOG_TO_SERIAL
for (int i=0;i<8;i++){ for (int i=0;i<8;i++){
Serial.print(" "); Serial.print(" ");

Loading…
Cancel
Save