Advertisement
Guest User

Untitled

a guest
May 26th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <SoftwareSerial.h>    
  2.  
  3. SoftwareSerial SIM900(10, 11); // (RX, TX). please zoom image above to see exactly what is going where.
  4.  
  5. void setup()
  6. {
  7.   SIM900.begin(19200);               // the SIM900 baud rate  
  8.   Serial.begin(19200);  
  9. }
  10.  
  11.  
  12. void loop()
  13. {
  14.   if (SIM900.available())              // if date is comming from softwareserial port ==> data is comming from gprs shield
  15.   Serial.write(SIM900.read());
  16.   if (Serial.available())                // if data is available on hardwareserial port ==> data is comming from PC or notebook
  17.   SIM900.write(Serial.read());
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement