Connect with us

interface arduino with telit gm862

Discussion in 'Microcontrollers, Programming and IoT' started by okili, Jun 3, 2012.

Scroll to continue with content
  1. okili

    okili

    1
    0
    Jun 3, 2012
    good morning

    i am facing problem interfacing my arduino with the gm862. Actually i am able to make a call to the gm862 module . but unable to make the microcontroller which is the atmega328 send a sms through rx and tx. this is the sample code that i have used is compiling without errors.
    #include <SoftwareSerial.h>

    int rxPin = 0;
    int txPin = 1;

    // set up a new serial port
    SoftwareSerial serial=SoftwareSerial(rxPin,txPin);

    void setup() {
    pinMode(rxPin, INPUT);
    pinMode(txPin, OUTPUT);

    // set the data rate for the SoftwareSerial port
    serial.begin(9600);

    // Set SMS to text mode. Note it is critical
    // to use \r\n to end each line
    // The delays are also critical, without them,
    // you may lose some of the
    // characters of your message

    serial.print("AT+CMGF=1\r\n");
    delay(300);
    serial.print("AT+CMGS=");
    delay(300);
    // Replace with a valid phone number
    serial.print("00233240582093\r\n");
    delay(300);
    serial.print("Hello from Arduino.");
    delay(300);

    // End the SMS with a control-z
    serial.write(0x1A);
    }

    void loop() {
    }
     
    Last edited: Jun 3, 2012
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-