working on minor timing problems
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
// include the library code:
|
// include the library code:
|
||||||
#include <SoftRS485.h>
|
#include <SoftRS485.h>
|
||||||
|
|
||||||
#define PROGRAM "RS485-Nano 2.0 / Sender 1.0"
|
#define PROGRAM "RS485-Nano 2.0 / Sender 1.1"
|
||||||
|
|
||||||
#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
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
#define Max485_DE 9 // data enable of Max485
|
#define Max485_DE 9 // data enable of Max485
|
||||||
#define Max485_DI 8 // data input of Max485
|
#define Max485_DI 8 // data input of Max485
|
||||||
|
|
||||||
#define TRESHOLD 100000 // 100ms
|
#define TRESHOLD 200000 // 200ms
|
||||||
#define ID 0
|
#define ID 0
|
||||||
// 0=Test
|
// 0=Test
|
||||||
// 1=Arbeitszimmer
|
// 1=Arbeitszimmer
|
||||||
@@ -83,8 +83,13 @@ void send(int btn){
|
|||||||
|
|
||||||
void loop(){
|
void loop(){
|
||||||
unsigned long now = micros();
|
unsigned long now = micros();
|
||||||
|
boolean pause = true;
|
||||||
for (int i=0;i<8;i++){
|
for (int i=0;i<8;i++){
|
||||||
if (states[i]){
|
if (states[i]){
|
||||||
|
if (pause){
|
||||||
|
delay(5);
|
||||||
|
pause=false;
|
||||||
|
}
|
||||||
if (now - times[i] > TRESHOLD){
|
if (now - times[i] > TRESHOLD){
|
||||||
#ifdef SEND_485
|
#ifdef SEND_485
|
||||||
send(i+1);
|
send(i+1);
|
||||||
|
|||||||
Reference in New Issue
Block a user