Pages: [1]   Go Down
Author Topic: SOLVED gprs shield  (Read 927 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 83
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello
i have a question
i am using the seeduino V1 gprs shield
http://www.seeedstudio.com/wiki/GPRS_Shield_V1.0

and i need a simple script that can make phone calls and receve them

the number that should be dailed (on press of a button) must be stored as a variable
and when called you must keep a  button pressed to talk (if you let go of the button it should hang up)

i have tryed to use the page for instructions but it onley talks about there serial monitor and i dont want to use that
and there is no mention of receving calls

who can help me
« Last Edit: December 21, 2013, 05:01:32 pm by robot797 » Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 83
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey guys

does this work with the seeduino gprs module?

http://www.dfrobot.com/community/gsmgprsgps-shield-tutorial-cid-and-one-touch-caller-id-dial.html

if so i do understand this code
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 83
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i found it out

i have rewritten the code of some guy here on the forums

Code:

 
 #include <SoftwareSerial.h>

 char inchar;                      // Will hold incoming character from the Serial Port
 SoftwareSerial GPRS(7,8);
 // unsigned char buffer[64];         // buffer array for data receive over serial port
 int count=0;                      // counter for buffer array
 int WTA = 13;                     //led
 int numring=0;                   
 int comring=1;


 void setup()
 {
   GPRS.begin(19200);              // the GPRS baud rate   
   Serial.begin(19200);            // the Serial port of Arduino baud rate.

   pinMode(9, OUTPUT);             // Power up SIM900 GPRS
   digitalWrite(9,LOW);
   delay(1000);
   digitalWrite(9,HIGH);
   delay(2000);
   digitalWrite(9,LOW);
   delay(1000);

   pinMode(WTA, OUTPUT);          // Defines pin 10 as a +5V Digital Output
   digitalWrite(WTA, LOW);        //Sets WT trigger back low
   delay(1000);

 } 

 void TriggerWTA()
 {
 // pinMode(WTA, OUTPUT);        // Defines pin 10 as a +5V Digital Output
 GPRS.println("ATA");                       //picks up when the led goes high
 digitalWrite(WTA, HIGH);        // Sets WT trigger HIGH
 delay(5000);
 digitalWrite(WTA, LOW);         //Sets WT trigger back low
GPRS.println("ATH");                //hangs up when led goes low
 
 }

 
 void loop()
 {
  if(GPRS.available() >0)          //If a character comes in from the cellular module...
  {
  inchar=GPRS.read();
  if (inchar=='R')
  {
  delay(10);
  inchar=GPRS.read();
  if (inchar=='I')
  {
  delay(10);
  inchar=GPRS.read();
  if (inchar=='N')
  {
  delay(10);
  inchar=GPRS.read();
  if (inchar=='G')
  {
  delay(10);
 
  numring++;                // So the phone (our GSM shield) has 'rung' once, i.e. if it were a real phone it would have sounded 'ring-ring'
  if (numring==comring)
  {
  numring=0; // reset ring counter
  TriggerWTA();
  }
  }
  }
  }
  }
  }
 }
Logged

Pages: [1]   Go Up
Jump to: