Skip to content

Instantly share code, notes, and snippets.

@LosantGists
LosantGists / arduino-modbus-rtu.ino
Created February 27, 2020 21:37
Example sketch that reads Modbus RTU data with an Arduino
#include <ArduinoModbus.h>
// How often (in milliseconds) the sensors will be read.
const unsigned long REPORT_INTERVAL = 1000;
void setup() {
Serial.begin(9600);
while(!Serial);
if (!ModbusRTUClient.begin(9600)) {