safwan092

Untitled

Apr 5th, 2025
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <SoftwareSerial.h>
  2.  
  3. SoftwareSerial ss(6, 5);
  4.  
  5. void setup() {
  6. Serial.begin(9600);
  7. ss.begin(9600);
  8. }
  9.  
  10. void loop() {
  11. if (Serial.available()) { // If anything comes in Serial (USB),
  12. ss.write(Serial.read()); // read it and send it out Serial1 (pins 0 & 1)
  13. }
  14.  
  15. if (ss.available()) { // If anything comes in Serial1 (pins 0 & 1)
  16. Serial.write(ss.read()); // read it and send it out Serial (USB)
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment