Proj 324 Final

Fork of ELEC351_Group_T by Plymouth ELEC351 Group T

Committer:
thomasmorris
Date:
Wed Aug 15 21:34:59 2018 +0000
Revision:
57:aba1296e51b1
Parent:
52:99915f5240b2
Final Version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
thomasmorris 52:99915f5240b2 1 /*
thomasmorris 52:99915f5240b2 2 This is where we control the Time of the MicroController and the DATA
thomasmorris 52:99915f5240b2 3 */
thomasmorris 52:99915f5240b2 4
thomasmorris 52:99915f5240b2 5 #ifndef _TIME_HPP_//Header Guards Prevents Multiple includes
thomasmorris 30:4cde05cc7c4f 6 #define _TIME_HPP_
thomasmorris 52:99915f5240b2 7 //Libraries and header includes
thomasmorris 30:4cde05cc7c4f 8 #include "mbed.h"
thomasmorris 30:4cde05cc7c4f 9 #include "rtos.h"
thomasmorris 31:4a88bf97b53e 10 #include <string>
thomasmorris 31:4a88bf97b53e 11 #include <iostream>
thomasmorris 31:4a88bf97b53e 12 #include <sstream>
thomasmorris 30:4cde05cc7c4f 13
thomasmorris 52:99915f5240b2 14 //Definitions of Parameters according to the UNIX time standard
thomasmorris 31:4a88bf97b53e 15 #define Days_In_Month 30.436875
thomasmorris 31:4a88bf97b53e 16 #define second 1
thomasmorris 31:4a88bf97b53e 17 #define minute 60
thomasmorris 31:4a88bf97b53e 18 #define hour 3600
thomasmorris 31:4a88bf97b53e 19 #define day 86400
thomasmorris 31:4a88bf97b53e 20 #define week 604800
thomasmorris 31:4a88bf97b53e 21 #define month 2629743
thomasmorris 31:4a88bf97b53e 22 #define year 31556926
thomasmorris 30:4cde05cc7c4f 23
thomasmorris 52:99915f5240b2 24 int get_current_time(); //Returns Current time
thomasmorris 52:99915f5240b2 25 void set_new_date(int days, int months, int years); //Sets the day,month and year
thomasmorris 52:99915f5240b2 26 void set_new_time(int hours, int minutes, int seconds); //Sets the hour, minute and seconds
thomasmorris 52:99915f5240b2 27 void Add_Second(); //Adds a seconds to time
thomasmorris 52:99915f5240b2 28 void Subtract_Second(); //Subtracts a second from time
thomasmorris 52:99915f5240b2 29 void Add_Minute(); //Add a minute to time
thomasmorris 52:99915f5240b2 30 void Subtract_Minute(); //Subtracts a minute from time
thomasmorris 52:99915f5240b2 31 void Add_Hour(); //Adds an hour to time
thomasmorris 52:99915f5240b2 32 void Subtract_Hour(); //Subtracts an hour from time
thomasmorris 52:99915f5240b2 33 void Add_Day(); //Add a day to time
thomasmorris 52:99915f5240b2 34 void Subtract_Day(); //Subtracts a day from time
thomasmorris 52:99915f5240b2 35 void Add_Month(); //Adds a month to time
thomasmorris 52:99915f5240b2 36 void Subtract_Month(); //Subtracts a month to time
thomasmorris 52:99915f5240b2 37 void Add_Year(); //Add a year to time
thomasmorris 52:99915f5240b2 38 void Subtract_Year(); //Subtracts a year from time
thomasmorris 31:4a88bf97b53e 39
thomasmorris 30:4cde05cc7c4f 40 #endif