Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ==============================================
- = Arduino SOS CAll sim900 shield Project =
- = with Arduino =
- = http://www.mrmodder.com =
- ==============================================
- #include "SIM900.h"
- #include <SoftwareSerial.h>
- #include "call.h"
- #define ACTIVE LOW
- const int ledPin = 13; // the number of the LED pin
- CallGSM call;
- boolean started=false;
- int buttonState = 1;
- const int buttonPin = 7; // the number of the pushbutton pin
- boolean calling = false;
- void setup()
- {
- Serial.begin(9600);
- pinMode(ledPin,OUTPUT);
- pinMode(buttonPin, INPUT);
- digitalWrite(buttonPin,HIGH);
- if (gsm.begin(9600))
- {
- Serial.println("\nstatus=READY");
- started=true;
- }
- else
- Serial.println("\nstatus=IDLE");
- }
- void loop()
- {
- buttonState = digitalRead(buttonPin);
- if (buttonState == ACTIVE) {
- if(calling)
- {
- digitalWrite(ledPin,LOW);
- calling = false;
- call.HangUp();
- delay(1000);
- }else
- {
- calling = true;
- digitalWrite(ledPin, HIGH);
- delay(1000);
- call.Call("+300000000000"); //Insert telephone number here
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement