MSS / Mbed 2 deprecated testVEML7700

Dependencies:   VEML7700 mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "MSS.h"
00003 #include "VEML7700.h"
00004 
00005 #ifndef MSU_VEML7700_I2C_ADDRESS
00006 #define MSU_VEML7700_I2C_ADDRESS 0x10
00007 #endif
00008 
00009 VEML7700 *veml7700 = 0 ;
00010 
00011 int main(void)
00012 {
00013     uint16_t als, white ;
00014     
00015     veml7700 = new VEML7700(PIN_SDA, PIN_SCL, MSU_VEML7700_I2C_ADDRESS) ; 
00016     veml7700->setALSConf(0x0000) ;
00017     veml7700->setPowerSaving(0x0000) ;
00018     
00019     printf("=== VEML7700 test for %s (%s) ===\n",BOARD_NAME, __DATE__) ;   
00020     printf("  ALS,   White\n") ; 
00021 
00022     while(1) {
00023         als = veml7700->getALS() ;
00024         white = veml7700->getWHITE() ;
00025         printf("%6d, %6d\n", als, white) ;
00026         wait(2) ;
00027     }
00028 }