![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
fuck this
Dependencies: BMP280
Diff: Sampling.h
- Revision:
- 8:dbb57b4d5ba4
- Parent:
- 7:bf9f92ff02e8
- Child:
- 9:ac5673cca703
--- a/Sampling.h Thu Jan 04 17:34:57 2018 +0000 +++ b/Sampling.h Thu Jan 04 19:32:30 2018 +0000 @@ -2,22 +2,11 @@ #define __Sampling__ #include "mbed.h" - -#ifdef BME -#include "BME280.h" -#else #include "BMP280.h" -#endif +#include "rtos.h" #define BUFFERSIZE 120 -#ifdef BME -extern BME280 sensor; -#else -extern BMP280 sensor; -#endif - -AnalogIn LDRSensor; //Input pin for LDR //Thread Sync Tools Mutex tempReadingsLock; @@ -31,20 +20,22 @@ float LDRReadings[BUFFERSIZE]; float timeReadings[BUFFERSIZE]; -unsigned short newestIndex; +extern unsigned short newestIndex; //Position in the buffer of the newest sample -unsigned short oldestIndex; +extern unsigned short oldestIndex; //Position in the buffer of the oldest sample -bool firstSample; +extern bool firstSample; //Used to indicate this is the first sample to be taken. used in IncrementIndex func Thread t1; //Sample Enviromental Sensor Thread t2; //Sample LDR Sensor Ticker sampleRate; -AnalogIn LDR(A13); //LDR Pin -DigitalOut SamplingLED(LED1); //Onboard LED showing when a sample happens +Timeout SampleLEDTimeout; +extern BMP280 sensor; +extern AnalogIn LDRSensor; //Input pin for LDR +extern DigitalOut SamplingLED; //Onboard LED showing when a sample happens /*These can be deleted I think extern float fLatestTemp; @@ -83,4 +74,7 @@ //Called after samples are added. Increments the index and moves the oldest //along if necessary +void FlipSamplingLED(void); +//Called by timeout, turns of LED + #endif \ No newline at end of file