LoRaWAN-Signal-Mapping/iot/main/main.ino

34 lines
838 B
Arduino
Raw Normal View History

#include <Arduino.h>
#include <TinyGPS++.h>
#include "settings.h"
#include "random.h"
// 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"
#include "gps.h"
void setup() {
Serial.begin(BAUD_PC);
2019-06-13 14:10:12 +00:00
Serial.println("[main] Beginning collection sequence.");
random_begin();
gps_begin();
TinyGPSLocation loc = gps_location();
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(")");
uint32_t id = random_get();
Serial.print("[main] id: ");
Serial.println(id);
}
void loop() {
}