Hello world program for the VL6180

Dependencies:   VL6180 mbed

Committer:
sburg
Date:
Mon Oct 19 16:47:41 2015 +0000
Revision:
0:2508f38e90fe
First commit of main program

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sburg 0:2508f38e90fe 1 #include "VL6180.h"
sburg 0:2508f38e90fe 2 #include "mbed.h"
sburg 0:2508f38e90fe 3
sburg 0:2508f38e90fe 4 VL6180 rf(p9, p10); //I2C sda and scl
sburg 0:2508f38e90fe 5 Serial pc(USBTX, USBRX); //USB serial
sburg 0:2508f38e90fe 6
sburg 0:2508f38e90fe 7 int main() {
sburg 0:2508f38e90fe 8 float reading;
sburg 0:2508f38e90fe 9 while(1) {
sburg 0:2508f38e90fe 10 reading = rf;
sburg 0:2508f38e90fe 11 pc.printf("Read %4.1f cm\n", reading);
sburg 0:2508f38e90fe 12 wait(0.5);
sburg 0:2508f38e90fe 13 }
sburg 0:2508f38e90fe 14 }