2019-06-12 19:18:37 +00:00
# include <Arduino.h>
2019-06-13 13:13:03 +00:00
# include <TinyGPS++.h>
2019-06-12 19:18:37 +00:00
# include "settings.h"
2019-06-13 13:33:08 +00:00
# include "random.h"
2019-06-13 13:47:40 +00:00
// BAD PRACTICE: For some extremely strange reason, the Arduino IDE doesn't pick up random.cpp like it does our other source files - so we've got to explicitly include it here. If we had control over the build process (which we don't), we've use a Makefile here that handled this better.
# include "random.cpp"
2019-06-12 19:18:37 +00:00
# include "gps.h"
2019-06-13 13:33:08 +00:00
2019-06-12 19:18:37 +00:00
void setup ( ) {
Serial . begin ( BAUD_PC ) ;
2019-06-13 14:10:12 +00:00
Serial . println ( " [main] Beginning collection sequence. " ) ;
2019-06-12 19:18:37 +00:00
2019-06-13 13:33:08 +00:00
random_begin ( ) ;
2019-06-12 19:18:37 +00:00
gps_begin ( ) ;
2019-06-13 13:33:08 +00:00
TinyGPSLocation loc = gps_location ( ) ;
2019-06-13 13:13:03 +00:00
gps_end ( ) ;
2019-06-13 14:10:12 +00:00
Serial . print ( " [main] Location: ( " ) ; Serial . print ( loc . lat ( ) ) ; Serial . print ( " , " ) ; Serial . print ( loc . lng ( ) ) ; Serial . println ( " ) " ) ;
2019-06-12 19:18:37 +00:00
2019-06-13 13:33:08 +00:00
uint32_t id = random_get ( ) ;
2019-06-12 19:18:37 +00:00
2019-06-13 13:33:08 +00:00
Serial . print ( " [main] id: " ) ;
Serial . println ( id ) ;
2019-06-12 19:18:37 +00:00
}
void loop ( ) {
}