Advertisement
gaetanopeti

Arduino Tx

Mar 15th, 2020
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. ///Tx//COM3
  2. #include <SoftwareSerial.h>
  3. SoftwareSerial s(3,2);
  4.  
  5. char mystr[6] = "Hello"; //String data
  6. char mystr2[10] = "MyFliends"; //String data 2
  7.  
  8. void setup() {
  9.   // Begin the Serial at 9600 Baud
  10.   Serial.begin(9600);
  11.   s.begin(9600);
  12. }
  13.  
  14. void loop() {
  15.   s.write(mystr,6); //Write the serial data
  16.   s.write('\0'); //'\n'
  17.   //Serial.write("",1);  //space
  18.   s.write(mystr2,10); //'\n'
  19.   s.write('\0');
  20.   delay(1000);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement