[WIP] Пытаемся сделать modbus

This commit is contained in:
Dima committed 2024-04-29 20:06:59 +03:00
1 parent 81e4b1de94
commit b31ab46c79
3 files changed
+42 -17

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
#include <ModbusSerial.h>
const int GPIOCoil = 0;
ModbusSerial modbus(Serial, 10);
bool coils[10];
int pinToRead = 2;
void setup() {
Serial.begin(9600);
pinMode(pinToRead, INPUT);
modbus.addIsts(0);
}
void loop() {
modbus.setIsts(0, digitalRead(pinToRead));
modbus.task ();
}