Hi,
I am using Arduino 328P Nano board and RS485 to ttl module for long distance communication.I will use RS485 to usb on another end of my application.I have given Tx,Rx of my Nano to TTL. DE,RE pins are shorted and connected in Digital pin 8 of Nano board.
I heard like we need to enable the pin before send the data on modbus and we need to disable once data is transmitted.
I have selected PIN 8 as digital pin.
find my code below and its not working
void setup() {
// Config Modbus Serial (port, speed, byte format)
pinMode(mode,OUTPUT);
mb.config(&Serial, 9600, SERIAL_8N1,mode);
pinMode(relay1, OUTPUT);
pinMode(relay2, OUTPUT);
pinMode(ledready, OUTPUT); //Blue LED
pinMode(lederror, OUTPUT); //RED LED
pinMode(ledok, OUTPUT); //GREEN LED
pinMode(buzzer, OUTPUT);