Hello world program for the VL6180

Dependencies:   VL6180 mbed

main.cpp

Committer:
sburg
Date:
2015-10-19
Revision:
0:2508f38e90fe

File content as of revision 0:2508f38e90fe:

#include "VL6180.h"
#include "mbed.h"

VL6180 rf(p9, p10); //I2C sda and scl
Serial pc(USBTX, USBRX); //USB serial

int main() {
    float reading;
    while(1) {
        reading = rf;
        pc.printf("Read %4.1f cm\n", reading);
        wait(0.5);
    }
}