![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Comments added and commented out outdated code
Dependencies: Peripherals SD_Lib Time_Lib_v2 Year3_Version5 BMP280 LCDFunctions TextLCD BME280 Serial_Lib
main.cpp@14:433745616744, 2019-01-03 (annotated)
- Committer:
- emilytrembeth
- Date:
- Thu Jan 03 13:52:58 2019 +0000
- Revision:
- 14:433745616744
- Parent:
- 13:a89d4591af3f
Comments added and Commented out the outdated code
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
noutram | 0:90e393878517 | 1 | #include "mbed.h" |
emilytrembeth | 4:da63962bc0f1 | 2 | #include "TextLCD.h" |
emilytrembeth | 4:da63962bc0f1 | 3 | #include "SDBlockDevice.h" |
emilytrembeth | 4:da63962bc0f1 | 4 | #include "FATFileSystem.h" |
erolleyparnell | 8:dde5976445b4 | 5 | #include "thread_functions.hpp" |
erolleyparnell | 11:799025124e87 | 6 | #include "SD_functions.hpp" |
erolleyparnell | 11:799025124e87 | 7 | #include "peripherals.hpp" |
emilytrembeth | 5:60e116a1e913 | 8 | |
erolleyparnell | 13:a89d4591af3f | 9 | #ifndef SD_Present |
erolleyparnell | 13:a89d4591af3f | 10 | #define SD_Present |
erolleyparnell | 13:a89d4591af3f | 11 | #endif |
erolleyparnell | 13:a89d4591af3f | 12 | |
erolleyparnell | 13:a89d4591af3f | 13 | #ifndef DEBUG |
erolleyparnell | 13:a89d4591af3f | 14 | #define DEBUG |
erolleyparnell | 13:a89d4591af3f | 15 | #endif |
erolleyparnell | 13:a89d4591af3f | 16 | |
erolleyparnell | 11:799025124e87 | 17 | //TextLCD lcd(D9, D8, D7, D6, D4, D2); // rs, e, d4-d7 |
erolleyparnell | 11:799025124e87 | 18 | //SDBlockDevice sd(PB_5, D12, D13, D10); // mosi, miso, sclk, cs |
emilytrembeth | 4:da63962bc0f1 | 19 | Serial pc(SERIAL_TX, SERIAL_RX); |
emilytrembeth | 4:da63962bc0f1 | 20 | time_t currentTime; |
emilytrembeth | 4:da63962bc0f1 | 21 | char lcdBuffer[32]; |
emilytrembeth | 4:da63962bc0f1 | 22 | DigitalOut myled(LED1); |
emilytrembeth | 4:da63962bc0f1 | 23 | Ticker ticker; |
emilytrembeth | 4:da63962bc0f1 | 24 | Mutex date_mutex; |
emilytrembeth | 5:60e116a1e913 | 25 | int setting; |
emilytrembeth | 5:60e116a1e913 | 26 | int t; |
emilytrembeth | 5:60e116a1e913 | 27 | //InterruptIn SW1; |
noutram | 0:90e393878517 | 28 | |
noutram | 1:948bd552a2a2 | 29 | Thread t1; |
noutram | 1:948bd552a2a2 | 30 | Thread t2; |
cgogay | 7:981670f59caf | 31 | Thread t3; |
erolleyparnell | 11:799025124e87 | 32 | Thread t4; |
cgogay | 7:981670f59caf | 33 | |
cgogay | 7:981670f59caf | 34 | |
cgogay | 7:981670f59caf | 35 | //LDR sensor |
cgogay | 7:981670f59caf | 36 | AnalogIn LDD_ADC_In(A1); |
cgogay | 7:981670f59caf | 37 | float fLDR = 0.0; |
cgogay | 7:981670f59caf | 38 | float volts = 0.0; |
cgogay | 7:981670f59caf | 39 | |
emilytrembeth | 4:da63962bc0f1 | 40 | |
emilytrembeth | 4:da63962bc0f1 | 41 | |
cgogay | 6:2ef9c06ce506 | 42 | //Main thread |
cgogay | 6:2ef9c06ce506 | 43 | int main() { |
cgogay | 6:2ef9c06ce506 | 44 | |
erolleyparnell | 11:799025124e87 | 45 | //Power On Check TODO |
cgogay | 6:2ef9c06ce506 | 46 | |
erolleyparnell | 11:799025124e87 | 47 | lcd.printf("Select Time Option\n\n"); |
cgogay | 6:2ef9c06ce506 | 48 | |
cgogay | 6:2ef9c06ce506 | 49 | // run threads |
cgogay | 6:2ef9c06ce506 | 50 | t1.start(FunctionSensor); |
emilytrembeth | 14:433745616744 | 51 | // t2.start(FunctionTime); |
emilytrembeth | 14:433745616744 | 52 | t2.start(FunctionSerial); |
emilytrembeth | 14:433745616744 | 53 | t3.start(FunctionSD2); |
cgogay | 6:2ef9c06ce506 | 54 | |
cgogay | 6:2ef9c06ce506 | 55 | } |