diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..714defa --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +Gerber diff --git a/Nano845-2.fzz b/Nano845-2.fzz new file mode 100644 index 0000000..a1d12a4 Binary files /dev/null and b/Nano845-2.fzz differ diff --git a/Nano845.fzz b/Nano845.fzz index 370a783..983cde5 100644 Binary files a/Nano845.fzz and b/Nano845.fzz differ diff --git a/Receiver/Receiver.ino b/Receiver/Receiver.ino index 7e70520..fb683e9 100644 --- a/Receiver/Receiver.ino +++ b/Receiver/Receiver.ino @@ -1,3 +1,5 @@ +// Für Controllino könnte man benutzen: sRx = 20, sTx = 21, enable = 53 + int sTx = 2; int sRx = 3; @@ -13,34 +15,34 @@ String message; void setup(){ pinMode(sRx,INPUT); pinMode(sTx,OUTPUT); - attachInterrupt(digitalPinToInterrupt(sRx),change,CHANGE); + attachInterrupt(digitalPinToInterrupt(sRx),change485,CHANGE); Serial.begin(115200); Serial.println("Receiver ready"); } -void reset(long dif){ +void reset485(long dif){ rcv = 0; idx = -1; message.reserve(32); } -void change(){ +void change485(){ bool bt = digitalRead(sRx); now = micros(); dif = now - lt; lt = now; if (dif > rst){ - reset(dif); + reset485(dif); } else { - handle(!bt,dif); + handle485(!bt,dif); } } -void handle(boolean bt, long dif){ +void handle485(boolean bt, long dif){ long count = dif/base; - for (int i=0; i=0) rcv |= bt<