MSS / Mbed 2 deprecated testVEML6030

Dependencies:   VEML6030 mbed vt100

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 "vt100.h"
00004 #include "VEML6030.h"
00005 
00006 #ifndef MSU_VEML6030_I2C_ADDRESS
00007 #define MSU_VEML6030_I2C_ADDRESS 0x10
00008 #endif
00009 
00010 VEML6030 *veml6030 = 0 ;
00011 
00012 vt100 *tty = 0 ;
00013 
00014 int main(void)
00015 {
00016     uint16_t als, white ;
00017     
00018     veml6030 = new VEML6030(PIN_SDA, PIN_SCL, MSU_VEML6030_I2C_ADDRESS) ;
00019     veml6030->setALSConf(0x0000) ; 
00020     veml6030->setPowerSaving(0x0000) ;
00021 
00022     tty = new vt100() ;
00023     tty->cls() ;
00024 
00025     printf("=== VEML6030 test for %s (%s)===\n", BOARD_NAME, __DATE__) ;   
00026     printf("Ambient, White\n") ; 
00027     
00028     while(1) {
00029         als = veml6030->getALS() ;
00030         white = veml6030->getWHITE() ;
00031         printf("%6d, %6d\n", als, white) ;
00032         wait(1) ;
00033     }
00034 }