|
| 1 | +/* |
| 2 | + * Simple M-BUS repeater for Arduino MBUS MKR Shield |
| 3 | + * Version 1.0 |
| 4 | + * Copyright (C) 2020 Hartmut Wendt www.zihatec.de |
| 5 | + * |
| 6 | + * This software will only repeat the serial commiunication of the serial port |
| 7 | + * to seria1 and back. Useful to test the MBUS shield and your MBUS devices. |
| 8 | + * |
| 9 | + * You will need the free software LorusFree to read MBUS devices |
| 10 | + * https://www.m-bus.de/lorus_download/lorusfree_setup.zip |
| 11 | + * |
| 12 | + * |
| 13 | + * This program is free software: you can redistribute it and/or modify |
| 14 | + * it under the terms of the GNU General Public License as published by |
| 15 | + * the Free Software Foundation, either version 3 of the License, or |
| 16 | + * (at your option) any later version. |
| 17 | + * |
| 18 | + * This program is distributed in the hope that it will be useful, |
| 19 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | + * GNU General Public License for more details. |
| 22 | + * |
| 23 | + * You should have received a copy of the GNU General Public License |
| 24 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 25 | +*/ |
| 26 | + |
| 27 | +void setup() |
| 28 | +{ |
| 29 | + Serial.begin(2400, SERIAL_8E1); |
| 30 | + Serial1.begin(2400, SERIAL_8E1); |
| 31 | +} |
| 32 | + |
| 33 | +void loop() |
| 34 | +{ |
| 35 | + //send any software serial data back out on serial1 link |
| 36 | + if (Serial1.available()) Serial.write(Serial1.read()); |
| 37 | + |
| 38 | + //send any serial1 data back out on serial link |
| 39 | + if (Serial.available())Serial1.write(Serial.read()); |
| 40 | +} |
0 commit comments