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

This commit is contained in:
Dima
2024-04-29 20:06:59 +03:00
parent 81e4b1de94
commit b31ab46c79
3 changed files with 42 additions and 17 deletions
+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 ();
}