CN0397 (Smart Visible Light Detection)
Dependencies: AD7798
For additional information check out the mbed page of the Analog Devices wiki: https://wiki.analog.com/resources/tools-software/mbed-drivers-all
Revision 1:77eb0888c15a, committed 2016-11-08
- Comitter:
- adisuciu
- Date:
- Tue Nov 08 09:56:25 2016 +0000
- Parent:
- 0:61b289f9bab0
- Commit message:
- Fixed for mbed online compiler (array initialization not allowed within class declaration)
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/AD7798.lib Tue Nov 08 09:56:25 2016 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/teams/AnalogDevices/code/AD7798/#fb6fe6fa2835
--- a/CN0397.cpp Mon Nov 07 15:57:44 2016 +0000 +++ b/CN0397.cpp Tue Nov 08 09:56:25 2016 +0000 @@ -61,10 +61,15 @@ while (pc.readable()) pc.getc(); } +const uint8_t CN0397::Channels[3] = { 1, 0, 2}; +const char CN0397::colour[3][6] = { "RED", "GREEN", "BLUE" }; +const uint8_t CN0397::ColorPrint[3] = { 31, 32, 34 }; +const uint8_t CN0397::Gain[8] = { 1, 2, 4, 8, 16, 32, 64, 128}; +const float CN0397::Lux_LSB[3] = {2.122, 2.124, 2.113}; +const float CN0397::Optimal_Levels[3] = {26909.0, 8880.0, 26909.0}; CN0397::CN0397(PinName cs) : ad7798(cs) -{ - +{ } void CN0397::display_data(void) {
--- a/CN0397.h Mon Nov 07 15:57:44 2016 +0000 +++ b/CN0397.h Tue Nov 08 09:56:25 2016 +0000 @@ -157,16 +157,14 @@ uint16_t modeReg, configReg, offsetReg, fullscaleReg, dataReg; uint16_t adcValue[3]; float voltageValue[3], intensityValue[3], lightConcentration[3]; - const uint8_t Channels[3] = { 1, 0, 2}; - const char colour[3][6] = { - "RED", "GREEN", "BLUE", - }; - - const uint8_t ColorPrint[3] = { 31, 32, 34 }; - const uint8_t Gain[8] = { 1, 2, 4, 8, 16, 32, 64, 128}; - const float Lux_LSB[3] = {2.122, 2.124, 2.113}; - const float Optimal_Levels[3] = {26909.0, 8880.0, 26909.0}; - + + static const uint8_t Channels[3]; + static const char colour[3][6]; + static const uint8_t ColorPrint[3]; + static const uint8_t Gain[8]; + static const float Lux_LSB[3]; + static const float Optimal_Levels[3]; + }; #endif /* CN0397_H_ */