program for final combination of working pieces

Dependencies:   SDFileSystem TMP102 mbed ISL29125

Fork of TEMP_Test by Thomas Dale

main.cpp

Committer:
Jeriah
Date:
2016-03-11
Revision:
0:547856de255b
Child:
1:e0fc716e2394

File content as of revision 0:547856de255b:

  //Authors: Tom, Nathan, Jeriah 
#include "mbed.h"
#include "RGBSensor.h"
#include "SDFileSystem.h"
#include "SDSave.h"

SDFileSystem fs(PTE3,PTE1,PTE2,PTE4,"fs");//SDFileSystem object
Timer t;

int main() {//main function, calls other files to move temp,RGB,PV,UV all to one managable function
    float lastTime = 0;
    float interval = 0.5;
    t.start();
    if (mountFailure()) {
        return -1; //end program with error status
    }
    uint16_t rgb[3];
    while (t.read()>60) {
      if (t.read()>lastTime+interval)  {
          lastTime=t.read();
          get_rgb(rgb);
          writeDate_testRGB(lastTime,rgb[0],rgb[1],rgb[2]);//send data to writeData in SDsave.cpp
          //we will get all rgb readings through an array, with the corresponding integers going in order red, green, blue
        }
    }
    closeDataFile();
}