 #include "HallEffect.h"
 #include "IMU.h"
 #include "SDHelper.h"
+#include <Time.h>
 
 /* hallEffect leftHall, rightHall; */
 potentiometer shockLeftPot, shockRightPot;


    if ((lastPrint + PRINT_SPEED) < millis())
    {
        sensorReading3 = imu.calcGyro(imu.gx);
        sensorReading4 = imu.calcGyro(imu.gy);
        sensorReading5 = imu.calcGyro(imu.gz);
        //accel readings
        sensorReading6 = imu.calcAccel(imu.ax);
        sensorReading7 = imu.calcAccel(imu.ay);
        sensorReading8 = imu.calcAccel(imu.az);
        lastPrint = millis(); // Update lastPrint time
    }
    // build the data string
    dataString = String(sensorReading1) + "," +
                 String(sensorReading2) + "," +
                 String(sensorReading3) + "," +
                 String(sensorReading4) + "," +
                 String(sensorReading5) + "," +
                 String(sensorReading6) + "," +
                 String(sensorReading7) + "," +
                 String(sensorReading8) + "," + // for IMU
                 String(shockLeftPos)   + "," +
                 String(shockRightPos)  + "," +
                 String(brakePressureFrontValue) + ",";
    // convert to CSV
    saveData(dataString); // save to SD card
}

// 53 on the Mega) must be left as an output or the SD
// library functions will not work.
const int CSpin = 10;
String dataString; // holds the data to be written to the SD card
float sensorReading1 = 0.00; // value read from your first sensor
float sensorReading2 = 0.00; // value read from your second sensor
float gyroX = 0.00; // value read from your third sensor
float gyroY = 0.00;
float gyroZ = 0.00;
float accelX = 0.00;
float accelY = 0.00;
float accelZ = 0.00;

#define PRINT_SPEED 250 // 250 ms between prints
static unsigned long lastPrint = 0; // Keep track of print time
