![](/media/cache/group/IMG_1289.JPG.50x50_q85.jpg)
A test program for VCNL4020
Dependencies: VCNL4020 mbed vt100
Diff: main.cpp
- Revision:
- 1:0891311fabe5
- Parent:
- 0:7502cb61069c
--- a/main.cpp Wed Mar 29 04:42:32 2017 +0000 +++ b/main.cpp Sat Apr 29 07:10:01 2017 +0000 @@ -27,6 +27,7 @@ printf("Product ID = %d, Revision = %d\n", vcnl4020->getProdID(), vcnl4020->getRevID()) ; + printf("Ambient Light, Proximity\n") ; while(1) { vcnl4020->trigBothOd() ; /* trigger both ALS and PROX */ @@ -38,7 +39,7 @@ /* wait for proximate data ready */ } prox = vcnl4020->getProx() ; - printf("VCNL4020 Ambient Light: %d Proximity: %d\n", als, prox) ; + printf("%6d, %6d\n", als, prox) ; wait(1) ; }