Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 #include "MSS.h" 00003 #include "S11059.h" 00004 00005 #define MSU_S11059_ADDRESS 0x2A 00006 00007 int main(void) 00008 { 00009 uint16_t uR, uG, uB, uIR ; 00010 uint8_t ctrl ; 00011 00012 S11059 *s11059 = new S11059(PIN_SDA, PIN_SCL, MSU_S11059_ADDRESS) ; 00013 printf("=== test S11059 for %s (%s) ===\n", BOARD_NAME, __DATE__) ; 00014 printf(" R, G, B, IR\n") ; 00015 00016 while(1) { 00017 ctrl = 0x89 ; // ADC reset, High Gain, integration time 1.4ms 00018 s11059->setControl(ctrl) ; 00019 ctrl = 0x09 ; // Release ADC reset, High Gain, integration time 1.4ms 00020 s11059->setControl(ctrl) ; // start measure 00021 wait(0.02) ; 00022 s11059->getRData(&uR) ; 00023 s11059->getGData(&uG) ; 00024 s11059->getBData(&uB) ; 00025 s11059->getIRData(&uIR) ; 00026 printf("%6d, %6d, %6d, %6d\n", uR, uG, uB, uIR) ; 00027 wait(1) ; 00028 } 00029 }
Generated on Fri Jul 22 2022 09:31:34 by
1.7.2