
aaa
Fork of 0NicksCoursework-lg by
Diff: components.cpp
- Revision:
- 5:9b4844128e09
- Child:
- 7:dd303488e55d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/components.cpp Fri Jan 05 14:13:43 2018 +0000 @@ -0,0 +1,52 @@ +#include "mbed.h" +#include "components.hpp" +#include "lglcd.h" + +//#include "Networkbits.hpp" +#define RED_DONE 1 +#define YELLOW_DONE 2 + +//Digital outputs +DigitalOut onBoardLED(LED1); +DigitalOut redLED(PE_15); +DigitalOut yellowLED(PB_10); +DigitalOut greenLED(PB_11); + +//Inputs +DigitalIn onBoardSwitch(USER_BUTTON); +DigitalIn SW1(PE_12); +DigitalIn SW2(PE_14); +//Serial pc(USBTX, USBRX); +AnalogIn adcIn(PA_0); + +//Environmental Sensor driver +#ifdef BME +BME280 sensor(D14, D15); +#else +BMP280 sensor(D14, D15); +#endif +lglcd mylcd(D7,D6,D5,D4,D3,D2); + +//POWER ON SELF TEST +void post() +{ + //posttest +} + +void errorCode(ELEC350_ERROR_CODE err) +{ + switch (err) { + case OK: + greenLED = 1; + wait(1.0); + greenLED = 0; + return; + case FATAL: + while(1) { + redLED = 1; + wait(0.1); + redLED = 0; + wait(0.1); + } + }; +} \ No newline at end of file