# GPRS Shield code

**URL:** <https://forum.arduino.cc/t/gprs-shield-code/502236>\
**Category:** Programming\
**Created:** [January 15, 2018, 5:51am UTC](https://forum.arduino.cc/t/gprs-shield-code/502236 "2018-01-15T05:51:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arduino\_user](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@arduino\_user](https://forum.arduino.cc/u/arduino_user)\
**Post date:** [January 15, 2018, 5:51am UTC](https://forum.arduino.cc/t/gprs-shield-code/502236/1 "2018-01-15T05:51:44Z")

</div>

Hi, Ive started arduino about a year ago and I was wondering how i could use a gprs shield. I placed my GPRS shield on the arduino UNO and it lit up. Yet, the code was had issues and I used a tinySine gprs shield.  
The code is as follows:  
#include \<GSM.h\>

#define PINNUMBER ""

// initialize the library instance  
GSM gsmAccess; // include a 'true' parameter for debug enabled  
GSM\_SMS sms;  
char remoteNumber[20]= "14086851138";

// char array of the message  
char txtMsg[200]="RUN IT OFFFFFFFFF YUH";

void setup()  
{  
// initialize serial communications  
Serial.begin(9600);

Serial.println("SMS Messages Sender");

// connection state  
boolean notConnected = true;

// Start GSM shield  
// If your SIM has PIN, pass it as a parameter of begin() in quotes  
while(notConnected)  
{  
if(gsmAccess.begin()==GSM\_READY){  
notConnected = false;  
}

else  
{  
Serial.println("Not connected");  
delay(1000);  
}  
}  
Serial.println("GSM initialized");  
sendSMS();  
}

void loop()  
{  
// nothing to see here  
}

void sendSMS(){

Serial.print("Message to mobile number: ");  
Serial.println(remoteNumber);

// sms text  
Serial.println("SENDING");  
Serial.println();  
Serial.println("Message:");  
Serial.println(txtMsg);

// send the message  
sms.beginSMS(remoteNumber);  
sms.print(txtMsg);  
sms.endSMS();  
Serial.println("\nCOMPLETE!\n");  
}

---

<div class="post-metadata">

**Author:** ![pert](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pert/32/217111_2.png) [@pert](https://forum.arduino.cc/u/pert)\
**Post date:** [January 15, 2018, 5:57am UTC](https://forum.arduino.cc/t/gprs-shield-code/502236/2 "2018-01-15T05:57:43Z")

</div>

Please use code tags ( **\</\>** button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:  
`[code]``[color=blue]// your code is here[/color]``[/code]`  
Using code tags and other important information is explained in the [How to use this forum post](http://forum.arduino.cc/index.php/topic,148850.0.html). Please read it.

> arduino\_user:  
> Yet, the code was had issues

Don't you think it would be helpful to explain what those issues were?

---

<div class="post-metadata">

**Author:** ![arduino\_user](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@arduino\_user](https://forum.arduino.cc/u/arduino_user)\
**Post date:** [January 15, 2018, 5:57am UTC](https://forum.arduino.cc/t/gprs-shield-code/502236/3 "2018-01-15T05:57:57Z")

</div>

Please reply asa  
Thank you for any help

The gprs shield is from: [https://www.ebay.com/itm/221236220201?rmvSB=true](https://www.ebay.com/itm/221236220201?rmvSB=true)  
The code has no errors, but when I run it, it doesn't work after writing SMS Messager and it stops

Please help asap thank you so much...

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 10:56pm UTC](https://forum.arduino.cc/t/gprs-shield-code/502236/4 "2021-05-05T22:56:51Z")

</div>


