#include #include #include #include #include //not sure if I'm using this #include #include "GPS.h" #include "sd.h" #include "oled.h" #include "acc.h" #include "hall.h" #include "buttons.h" int counter = 0; String ride = "ride1.gpx"; #define WIRE1_SDA 2 #define WIRE1_SCL 3 void setup() { Serial.begin(9600); // (I think) MUST be this speed for the GPS to work. Maybe you can change this but GPS must be 9600 Wire1.setSDA(WIRE1_SDA); Wire1.setSCL(WIRE1_SCL); Wire1.begin(); setup_gps(); setup_sd(); //Using SPI1 setup_oled(); // Using Wire1 setup_oled1(); setup_acc(); setup_hall(); //nothing happening here setup_buttons(); //oled_testing(); } void loop() { //if there is a message, save it in the sd card then read the sd card //Display three options (start ride, setup, send rides) //if start ride //open a new file with a new ride name in the SD card //read GPS //write the GPX header to it using this point //write this GPS point and the following points in file //if end the ride (long press side button) //write foot to GPX file //go back to the main menue //if setup //display deviceID //display clientId //display url to edit the client ID through the web //send ride //POST request the GPX files //if successful, delete the files buttons_read(); // Read button states read_gps(); oled_print_gps(); acc_meas(); oled1_print_acc(acc_x, acc_y, acc_z); /* if(read_gps()) { //sd_write(ride, msg); //sd_read(ride); //oled_print_gps(); acc_meas(); acc_meas_print(); hall_meas(); hall_meas_print(); delay(2000); }*/ }