program for final combination of working pieces
Dependencies: SDFileSystem TMP102 mbed ISL29125
Fork of TEMP_Test by
main.cpp
- Committer:
- tdale19
- Date:
- 2016-03-31
- Revision:
- 7:6becc29457ce
- Parent:
- 6:61b76e7dc5b7
- Child:
- 8:28f8162d2929
File content as of revision 7:6becc29457ce:
//Authors: Tom, Nathan, Jeriah #include "mbed.h" #include "TEMPSensor.h" #include "SDFileSystem.h" #include "SDSave.h" #include "SolarPanel.h" Timer t; DigitalOut ledBlue(LED_BLUE); DigitalOut ledRed(LED_RED); Serial pc(USBTX,USBRX); 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; ledRed = 0; ledBlue = 1; wait(0.5); t.start(); pc.printf("The timer has started\n\r"); if (mountSDCard()) { return -1; //end program with error status } pc.printf("The SD card is mounted\n\r"); ledRed = 1; createDataFile_testTEMP(); while (t.read()<60) { if (t.read()>(lastTime+interval)) { lastTime=t.read(); pc.printf("temp ouside = %.2f (c) \t inside = %.2f (c) \t on panel = %.2f (c) \t solar volage = %.2f (V) \n\r" ,get_outsideTemp(),get_insideTemp(),get_panelTemp(),get_solar());//prints titles and data of Temp readings writeData(lastTime,get_outsideTemp(),get_insideTemp(),get_panelTemp(),get_solar());//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(); ledBlue = 0; while (true) {}; }