GsmPort.println("AT+CNMI=2,2,0,0,0") // AT Command to recieve a live SMS GsmPort.println((char)26) // ASCII code of CTRL+Z GsmPort.println("Accident Alert") // The SMS text you want to send GsmPort.println("AT+CMGS=\"+91xxxxxxxxxx\"\r") // Replace x with mobile number GsmPort.println("AT+CMGF=1") //Sets the GSM Module in Text Mode gpsPort.begin( 9600 ) // Not needed if GPS on pin 0 #define gpsPort Serial // GPS TX connected to Arduino RX pin 0 AltSoftSerial gsmPort // must be on specific pins (8 & 9 for an UNO) You could use Serial on any board (disconnect GPS Use Serial1 on a Mega, Leo or Due board Something like this would work on an UNO: //GSM Serial.println("** No characters received from GPS: check wiring **") Serial.print(flon = TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6) Serial.print(flat = TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6) For one second we parse GPS data and report some key valuesįor (unsigned long start = millis() millis() - start < 1000 ) TinyGPS gps //Creates a new instance of the TinyGPS object MySerial.println("AT+CNMI=2,2,0,0,0") // AT Command to recieve a live SMS MySerial.println((char)26) // ASCII code of CTRL+Z MySerial.println("Accident Alert") // The SMS text you want to send MySerial.println("AT+CMGS=\"+91xxxxxxxxxx\"\r") // Replace x with mobile number MySerial.println("AT+CMGF=1") //Sets the GSM Module in Text ModeÄelay(1000) // Delay of 1000 milli seconds or 1 second Serial.begin(9600) // Setting the baud rate of Serial Monitor (Arduino) MySerial.begin(9600) // Setting the baud rate of GSM Module Below I'm pasting GSM and GPS codes, please help me to club those for my requirement. In my project I'm trying to interface GSM 900 module with L80 GPS module in such a way that when pin 12 of Arduino is high, then using GSM, the present coordinate of the location where the user is present has to be send to the predefined number.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |