This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Code

By: a guest on Jan 1st, 2014  |  syntax: C  |  size: 2.09 KB  |  views: 4  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //Test 1
  2. /* gps wiring:
  3. gps    arduino
  4. VIN --> 5v
  5. GND --> GND
  6. RX  --> Digital 8
  7. TX  --> Digital 9
  8. FIX --> Digital 4
  9. */
  10.  
  11.  
  12. //libraries
  13. #include <AltSoftSerial.h>
  14. #include <Adafruit_GPS.h>
  15. #include <SD.h>
  16. #include <GSM.h>
  17. #include <GSM3CircularBuffer.h>
  18. #include <GSM3MobileAccessProvider.h>
  19. #include <GSM3MobileCellManagement.h>
  20. #include <GSM3MobileClientProvider.h>
  21. #include <GSM3MobileClientService.h>
  22. #include <GSM3MobileDataNetworkProvider.h>
  23. #include <GSM3MobileMockupProvider.h>
  24. #include <GSM3MobileNetworkProvider.h>
  25. #include <GSM3MobileNetworkRegistry.h>
  26. #include <GSM3MobileServerProvider.h>
  27. #include <GSM3MobileServerService.h>
  28. #include <GSM3MobileSMSProvider.h>
  29. #include <GSM3MobileVoiceProvider.h>
  30. #include <GSM3ShieldV1.h>
  31. #include <GSM3ShieldV1AccessProvider.h>
  32. #include <GSM3ShieldV1BandManagement.h>
  33. #include <GSM3ShieldV1BaseProvider.h>
  34. #include <GSM3ShieldV1CellManagement.h>
  35. #include <GSM3ShieldV1ClientProvider.h>
  36. #include <GSM3ShieldV1DataNetworkProvider.h>
  37. #include <GSM3ShieldV1DirectModemProvider.h>
  38. #include <GSM3ShieldV1ModemCore.h>
  39. #include <GSM3ShieldV1ModemVerification.h>
  40. #include <GSM3ShieldV1MultiClientProvider.h>
  41. #include <GSM3ShieldV1MultiServerProvider.h>
  42. #include <GSM3ShieldV1PinManagement.h>
  43. #include <GSM3ShieldV1ScanNetworks.h>
  44. #include <GSM3ShieldV1ServerProvider.h>
  45. #include <GSM3ShieldV1SMSProvider.h>
  46. #include <GSM3ShieldV1VoiceProvider.h>
  47. #include <GSM3SMSService.h>
  48. #include <GSM3SoftSerial.h>
  49. #include <GSM3VoiceCallService.h>
  50.  
  51.  
  52. //Define ports for softserial
  53. AltSoftSerial mySerial;
  54.  
  55. //set gps as softserial 9,8
  56.  
  57. Adafruit_GPS GPS(&mySerial);
  58.  
  59.  
  60. //set pin4 as "gps lock pin"
  61. int fix = 4;
  62.  
  63. void setup() {
  64.   //start hardware serial
  65.   Serial.begin(115200);
  66.  
  67.   //Start softserial gps
  68.   GPS.begin(9600);
  69.  
  70.   //Specify which string to "get"
  71.   GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
  72.  
  73.   //Set pin 4 (fix) as input
  74.   pinMode(fix, INPUT);
  75.  
  76. }
  77.  
  78. void loop() {
  79.   //read button status to fixstatus
  80.   int fixstatus = digitalRead(fix);
  81.  
  82.   //Echo this to serial (11500)
  83.   Serial.println(fixstatus);
  84.   delay(2);
  85. }
clone this paste RAW Paste Data