This is the assessment project
Dependencies: C12832 FXOS8700Q LM75B mbed
Fork of app-shield-LM75B by
Diff: core.h
- Revision:
- 10:5cf5a731af73
- Parent:
- 9:b14eedf2e34b
--- a/core.h Mon Feb 22 08:26:43 2016 +0000 +++ b/core.h Mon Feb 22 09:03:00 2016 +0000 @@ -25,7 +25,9 @@ m_i2c(PTE25, PTE24), m_accelerometer(m_i2c, FXOS8700CQ_SLAVE_ADDR1), m_magnetometer(m_i2c, FXOS8700CQ_SLAVE_ADDR1), - m_stateEntred(false) + m_stateEntred(false), + m_updateRate(SCREEN_REFRESH_VALUE), + m_potentiometerLeft(A0) {} virtual ~Core() {} enum Mode { @@ -49,7 +51,13 @@ void update(); private: + /** + * Used to change the shield led color + */ void setLedColor(float red, float green, float blue); + /** + * Used to write text on the LCD screen + */ void writeText(const char* text, int x, int y, ...); // Triggers @@ -65,21 +73,23 @@ void stateMagnetometer(); private: - volatile Mode m_mode; - PwmOut m_ledR; - PwmOut m_ledG; - PwmOut m_ledB; - C12832 m_lcd; - LM75B m_temperature; - InterruptIn m_btnNext; - InterruptIn m_btnOpt; - void (Core::*m_states[MODES_COUNT])(); - volatile bool m_optTrigger; - Ticker m_stateTicker; - I2C m_i2c; - FXOS8700QAccelerometer m_accelerometer; - FXOS8700QMagnetometer m_magnetometer; - bool m_stateEntred; + volatile Mode m_mode; /*< The current selected state */ + PwmOut m_ledR; /*< the LED Red color controller */ + PwmOut m_ledG; /*< the LED Green color controller */ + PwmOut m_ledB; /*< the LED Blue color controller */ + C12832 m_lcd; /*< The LCD Object */ + LM75B m_temperature; /*< The temperature mesurement device */ + InterruptIn m_btnNext; /*< The SW2 button */ + InterruptIn m_btnOpt; /*< The SW3 button */ + void (Core::*m_states[MODES_COUNT])(); /*< Method pointers array for the states */ + volatile bool m_optTrigger; /*< Manage the states modes */ + Ticker m_stateTicker; /*< The state ticker, to update the scene */ + I2C m_i2c; /*< i2c definition */ + FXOS8700QAccelerometer m_accelerometer; /*< the accelerometer device */ + FXOS8700QMagnetometer m_magnetometer; /*< the magnetometer device */ + bool m_stateEntred; /*< Defined to false when entring to a new state. Used to enable the used device */ + float m_updateRate; /*< The update rate (in seconds */ + AnalogIn m_potentiometerLeft; /*< the potentiometer device */ }; #endif /* !CORE_H_ */ \ No newline at end of file