Advertisement
pleasedontcode

RS485 Sender

Aug 1st, 2024
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Arduino 0.30 KB | Source Code | 0 0
  1. #include <SoftwareSerial.h>
  2.  
  3. SoftwareSerial RS485Serial(2, 3); // RX, TX
  4.  
  5. void setup() {
  6.   pinMode(4, OUTPUT); // Control the DE/RE pin
  7.   digitalWrite(4, HIGH); // Set to transmit mode
  8.   RS485Serial.begin(9600);
  9. }
  10.  
  11. void loop() {
  12.   RS485Serial.println("Hello from Arduino!");
  13.   delay(1000);
  14. }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement