Guest User

Untitled

a guest
Nov 21st, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. ==============================================
  2. = Arduino SOS CAll sim900 shield Project =
  3. = with Arduino =
  4. = http://www.mrmodder.com =
  5. ==============================================
  6. #include "SIM900.h"
  7. #include <SoftwareSerial.h>
  8. #include "call.h"
  9.  
  10. #define ACTIVE LOW
  11.  
  12. const int ledPin = 13; // the number of the LED pin
  13.  
  14. CallGSM call;
  15. boolean started=false;
  16. int buttonState = 1;
  17. const int buttonPin = 7; // the number of the pushbutton pin
  18. boolean calling = false;
  19.  
  20. void setup()
  21. {
  22.  
  23. Serial.begin(9600);
  24. pinMode(ledPin,OUTPUT);
  25. pinMode(buttonPin, INPUT);
  26. digitalWrite(buttonPin,HIGH);
  27. if (gsm.begin(9600))
  28. {
  29. Serial.println("nstatus=READY");
  30. started=true;
  31. }
  32. else
  33. Serial.println("nstatus=IDLE");
  34. }
  35.  
  36. void loop()
  37. {
  38. buttonState = digitalRead(buttonPin);
  39. if (buttonState == ACTIVE) {
  40. if(calling)
  41. {
  42. digitalWrite(ledPin,LOW);
  43. calling = false;
  44. call.HangUp();
  45. delay(1000);
  46. }else
  47. {
  48. calling = true;
  49. digitalWrite(ledPin, HIGH);
  50. delay(1000);
  51. call.Call("+300000000000"); //Insert telephone number here
  52.  
  53. }
Add Comment
Please, Sign In to add comment