MSS
/
testVEML7700
test program for VEML7700
main.cpp@4:fd986c9c7c93, 2017-05-19 (annotated)
- Committer:
- Rhyme
- Date:
- Fri May 19 06:21:53 2017 +0000
- Revision:
- 4:fd986c9c7c93
- Parent:
- 1:9d2c3ffc80cf
vt100 lib removed for simplicity
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Rhyme | 0:bf177d3fef4e | 1 | #include "mbed.h" |
Rhyme | 0:bf177d3fef4e | 2 | #include "MSS.h" |
Rhyme | 0:bf177d3fef4e | 3 | #include "VEML7700.h" |
Rhyme | 0:bf177d3fef4e | 4 | |
Rhyme | 0:bf177d3fef4e | 5 | #ifndef MSU_VEML7700_I2C_ADDRESS |
Rhyme | 0:bf177d3fef4e | 6 | #define MSU_VEML7700_I2C_ADDRESS 0x10 |
Rhyme | 0:bf177d3fef4e | 7 | #endif |
Rhyme | 0:bf177d3fef4e | 8 | |
Rhyme | 0:bf177d3fef4e | 9 | VEML7700 *veml7700 = 0 ; |
Rhyme | 0:bf177d3fef4e | 10 | |
Rhyme | 0:bf177d3fef4e | 11 | int main(void) |
Rhyme | 0:bf177d3fef4e | 12 | { |
Rhyme | 0:bf177d3fef4e | 13 | uint16_t als, white ; |
Rhyme | 0:bf177d3fef4e | 14 | |
Rhyme | 0:bf177d3fef4e | 15 | veml7700 = new VEML7700(PIN_SDA, PIN_SCL, MSU_VEML7700_I2C_ADDRESS) ; |
Rhyme | 1:9d2c3ffc80cf | 16 | veml7700->setALSConf(0x0000) ; |
Rhyme | 1:9d2c3ffc80cf | 17 | veml7700->setPowerSaving(0x0000) ; |
Rhyme | 0:bf177d3fef4e | 18 | |
Rhyme | 1:9d2c3ffc80cf | 19 | printf("=== VEML7700 test for %s (%s) ===\n",BOARD_NAME, __DATE__) ; |
Rhyme | 1:9d2c3ffc80cf | 20 | printf(" ALS, White\n") ; |
Rhyme | 0:bf177d3fef4e | 21 | |
Rhyme | 0:bf177d3fef4e | 22 | while(1) { |
Rhyme | 0:bf177d3fef4e | 23 | als = veml7700->getALS() ; |
Rhyme | 0:bf177d3fef4e | 24 | white = veml7700->getWHITE() ; |
Rhyme | 1:9d2c3ffc80cf | 25 | printf("%6d, %6d\n", als, white) ; |
Rhyme | 1:9d2c3ffc80cf | 26 | wait(2) ; |
Rhyme | 0:bf177d3fef4e | 27 | } |
Rhyme | 0:bf177d3fef4e | 28 | } |