test program for VEML6040

Dependencies:   VEML6040 mbed

Committer:
Rhyme
Date:
Thu Apr 13 07:16:39 2017 +0000
Revision:
1:599953bd522a
Parent:
main.cpp@0:635c63ad3ec9
Child:
2:77b9cdf3b4fc
Renamed main.cpp to test_VEML6040.cpp; I'm tired of having too many main.cpps in my workspace

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rhyme 0:635c63ad3ec9 1 #include "mbed.h"
Rhyme 0:635c63ad3ec9 2 #include "MSS.h"
Rhyme 0:635c63ad3ec9 3 #include "VEML6040.h"
Rhyme 0:635c63ad3ec9 4
Rhyme 0:635c63ad3ec9 5 #define MSU_VEML6040_ADDRESS 0x10
Rhyme 0:635c63ad3ec9 6
Rhyme 0:635c63ad3ec9 7 VEML6040 *veml6040 = 0 ;
Rhyme 0:635c63ad3ec9 8
Rhyme 0:635c63ad3ec9 9 int main() {
Rhyme 0:635c63ad3ec9 10 uint16_t R, G, B, W ;
Rhyme 0:635c63ad3ec9 11 veml6040 = new VEML6040(PIN_SDA, PIN_SCL, MSU_VEML6040_ADDRESS) ;
Rhyme 0:635c63ad3ec9 12 veml6040->setCOLORConf(0x00) ;
Rhyme 0:635c63ad3ec9 13
Rhyme 0:635c63ad3ec9 14 printf("=== VEML6040 Test for %s ( %s ) ===\n", BOARD_NAME, __DATE__) ;
Rhyme 0:635c63ad3ec9 15 while(1) {
Rhyme 0:635c63ad3ec9 16 veml6040->getRData(&R) ;
Rhyme 0:635c63ad3ec9 17 veml6040->getGData(&G) ;
Rhyme 0:635c63ad3ec9 18 veml6040->getBData(&B) ;
Rhyme 0:635c63ad3ec9 19 veml6040->getWData(&W) ;
Rhyme 0:635c63ad3ec9 20 printf("R:%d G:%d B:%d W:%d\n", R,G,B,W) ;
Rhyme 0:635c63ad3ec9 21 wait(1) ;
Rhyme 0:635c63ad3ec9 22 }
Rhyme 0:635c63ad3ec9 23 }