@@ -65,48 +65,50 @@ void setup() {
6565void loop () {
6666 modbus.update ();
6767}
68+ ` ` `
6869
69-
70- Modbus Commands
70+ # ## Modbus Commands
7171Turn LED ON: Send 01 06 00 05 00 01 [CRC] (writes 1 to register 5).
7272
7373Turn LED OFF: Send 01 06 00 05 00 00 [CRC] (writes 0 to register 5).
7474
7575Read Registers: Send 01 03 00 00 00 0A [CRC] (reads 10 registers starting from 0).
7676
77- Customization
77+ # ## Customization
7878You can adjust settings at runtime:
7979
80+ ` ` ` cpp
8081modbus.setSlaveAddress(0x02); // Change slave address to 0x02
8182modbus.setLedPin(12); // Change LED pin to 12
8283modbus.setLedRegisterIndex(7); // Use register 7 for LED control
8384modbus.setModbusBaudRate(115200); // Change baud rate to 115200
85+ ` ` `
8486
85- Hardware Requirements
87+ # # Hardware Requirements
8688Any Arduino-compatible board with a serial interface (e.g., Uno, Mega, Nano).
8789
8890An LED connected to the specified pin (default: pin 13, onboard LED on most Arduino boards).
8991
9092A Modbus master device or software (e.g., Modbus Poll, QModMaster) for testing.
9193
92- Dependencies
94+ # # Dependencies
9395None (uses only the Arduino core library).
9496
95- Contributing
97+ # # Contributing
9698Contributions are welcome! Feel free to:
9799Fork this repository.
98100
99101Create a new branch for your feature or bug fix.
100102
101103Submit a pull request with a clear description of your changes.
102104
103- License
105+ # # License
104106This project is licensed under the MIT License. See the LICENSE file for details.
105107Acknowledgments
106108Developed with assistance from Grok, created by xAI.
107109
108110Inspired by the need for a simple Modbus RTU slave implementation on Arduino.
109111
110- Contact
112+ # # Contact
111113For questions or support, open an issue on this repository or reach out to [
[email protected] (mailto:
[email protected] )].
112114
0 commit comments