User Tools

Site Tools


arduino:sim900

GPS and GPRS board

http://wiki.seeed.cc/GPRS_Shield_v1.0/

https://raw.githubusercontent.com/SeeedDocument/GPRS_Shield_v1.0/master/img/GPRS_Shield_interface.png

//Serial Relay - Arduino will patch a
//serial link between the computer and the GPRS Shield
//at 19200 bps 8-N-1
//Computer is connected to Hardware UART
//GPRS Shield is connected to the Software UART

#include <SoftwareSerial.h>
SoftwareSerial GPRS(7, 8);
void setup()
{
    GPRS.begin(19200);               // the GPRS baud rate
    Serial.begin(19200);             // the Serial port of Arduino baud rate.
}

void loop()
{
    if (GPRS.available())
    Serial.write(GPRS.read()); 
    if (Serial.available())            // if data is available on hardwareserial port ==> data is comming from PC or notebook
    GPRS.write(Serial.read());       // write it to the GPRS shield
}
arduino/sim900.txt · Last modified: by aistis