Advertisement
Guest User

Code

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