Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BME280 BMP280 TextLCD
SAMPLE.cpp
00001 #include "SAMPLE.hpp" 00002 00003 00004 void Sampling_ISR() 00005 { 00006 t1.signal_set(SamplingTime); 00007 } 00008 void Sample_Event()//Samples the hardware and prints the result to the LCD 00009 { 00010 while(1) 00011 { 00012 Thread::signal_wait(SamplingTime); //Set the time between samples 00013 if(Log_Value == 3){pc.printf("Sample Being Taken\n");} 00014 Data_Active.set_temperature(sensor.getTemperature()); //Read Temperature 00015 Data_Active.set_pressure(sensor.getPressure()); //Read Pressure 00016 Data_Active.set_light(adcIn.read()); //Read Light 00017 if(Log_Value == 3){pc.printf("Temp Taken: %1.1f Pressure Taken: %1.1f Light Taken: %1.1f\n",sensor.getTemperature(),sensor.getPressure(),adcIn.read());} 00018 Time_Lock_Main.lock(); 00019 time_t buffer_time = time(NULL); 00020 Time_Lock_Main.unlock(); 00021 00022 Data_Active.set_time(buffer_time); 00023 00024 Red_led.flash(0.02);//ahh he saved everyone of us 00025 Write_Pointer = Write_Data(Data_Active,Write_Pointer); 00026 t1.signal_set(NotSamplingTime); 00027 if(Log_Value == 3){pc.printf("New Sample avaliable\n");} 00028 t2.signal_set(SD_Data_Ready); 00029 } 00030 }
Generated on Sun Jul 31 2022 05:12:27 by
1.7.2