SHARE
TWEET

Untitled

a guest Jun 25th, 2019 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<SoftwareSerial.h> //Included SoftwareSerial Library
  2. //Started SoftwareSerial at RX and TX pin of ESP8266/NodeMCU
  3. SoftwareSerial s(3,1);
  4.  
  5. void setup() {
  6.   //Serial S Begin at 9600 Baud
  7.   s.begin(9600);
  8. }
  9.  
  10. void loop() {
  11.   //Write '123' to Serial
  12.   s.write('h');
  13.   delay(1000);
  14. }
  15.      
  16. int data; //Initialized variable to store recieved data
  17.  
  18. void setup() {
  19.   //Serial Begin at 9600 Baud
  20.   Serial.begin(9600);
  21.   Serial1.begin(9600);
  22. }
  23.  
  24. void loop() {
  25.   if(Serial1.available()){
  26.   data = Serial1.read(); //Read the serial data and store it
  27.   delay(1000);
  28.   Serial.print(data);}
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top