Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

37 wiersze
580 B

  1. #include "GpsTracker.h"
  2. void setup() {
  3. #ifdef _DEBUG
  4. debug::waitForSerial();
  5. Log.begin(LOG_LEVEL_VERBOSE, &Serial);
  6. #endif
  7. rtc::powerOn();
  8. rtc::setup();
  9. rtc::powerOff();
  10. }
  11. void loop() {
  12. gps::powerOn();
  13. SIM808_GPS_STATUS gpsStatus = gps::acquireCurrentPosition(30000);
  14. gps::powerOff();
  15. if (gpsStatus > SIM808_GPS_STATUS::NO_FIX) {
  16. tmElements_t time;
  17. gps::getTime(time);
  18. rtc::powerOn();
  19. rtc::setTime(time);
  20. rtc::powerOff();
  21. positions::appendLast();
  22. }
  23. if (positions::needsToSend()) {
  24. positions::send();
  25. }
  26. mainunit::deepSleep(10); //duration TBD
  27. }