pwm period is now 200us instead of the default 20ms veml6040 config is now AF_BIT | TRIG_BIT
Dependencies: mbed MMA8451Q USBDevice WakeUp vt100
Fork of afero_node_suntory_2017_06_15 by
Revision 23:e4d2316383a1, committed 2017-10-18
- Comitter:
- Rhyme
- Date:
- Wed Oct 18 00:31:13 2017 +0000
- Parent:
- 22:44b33ef643b9
- Commit message:
- pwm period is now 200us from default 20ms; veml6040->setCOLORCOnf is now AF_BIT | TRIG_BIT from 0x00;
Changed in this revision
sensors/Color/Color_VEML6040.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/sensors/Color/Color_VEML6040.cpp Wed Jun 21 02:04:56 2017 +0000 +++ b/sensors/Color/Color_VEML6040.cpp Wed Oct 18 00:31:13 2017 +0000 @@ -1,5 +1,9 @@ #include "Color_VEML6040.hpp" +/* following 2 lines were added by Motoo Tanaka on 18-Oct-2017 */ +#define AF_BIT 0x02 +#define TRIG_BIT 0x04 + Color_VEML6040::Color_VEML6040() { CountDownToSystemReset::create(2); @@ -11,6 +15,9 @@ LEDs[0]->write(1.0) ; LEDs[1]->write(1.0) ; LEDs[2]->write(1.0) ; + LEDs[0]->period_us(200) ; /* pwm period 200us */ + LEDs[1]->period_us(200) ; /* pwm period 200us */ + LEDs[2]->period_us(200) ; /* pwm period 200us */ m_veml6040 = new VEML6040((PinName)PINS::COLOR::SDA, (PinName)PINS::COLOR::SCL, SENSORS::VEML6040::ADDRESS); m_veml6040->setCOLORConf(0x00) ; /* default setting */ callbackLED = &Color_VEML6040::prepare_LED; @@ -155,7 +162,7 @@ SENSORS::VEML6040::PWM_LED_R_UI16, SENSORS::VEML6040::PWM_LED_G_UI16, SENSORS::VEML6040::PWM_LED_B_UI16); - m_veml6040->setCOLORConf(0x00) ; /* default setting */ + m_veml6040->setCOLORConf(AF_BIT | TRIG_BIT) ; /* Force mode with Trigger */ SERIAL_PRINT_DBG("LED:TURNED ON. Timer start\n"); LED_Timer->start(); }