Testing of reflection sensor query

Dependencies:   Test_motor mbed

Committer:
bayagich
Date:
Tue May 20 14:24:40 2014 +0000
Revision:
1:5de755abb8d3
Test for reflection sensor query ;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bayagich 1:5de755abb8d3 1 #include "mbed.h"
bayagich 1:5de755abb8d3 2 #include "m3pi_ng.h"
bayagich 1:5de755abb8d3 3
bayagich 1:5de755abb8d3 4 DigitalOut myled(LED1);
bayagich 1:5de755abb8d3 5
bayagich 1:5de755abb8d3 6 m3pi george;
bayagich 1:5de755abb8d3 7
bayagich 1:5de755abb8d3 8 int main() {
bayagich 1:5de755abb8d3 9
bayagich 1:5de755abb8d3 10 int query[5];
bayagich 1:5de755abb8d3 11
bayagich 1:5de755abb8d3 12 george.sensor_auto_calibrate();
bayagich 1:5de755abb8d3 13
bayagich 1:5de755abb8d3 14 //put into query array of 5
bayagich 1:5de755abb8d3 15 george.calibrated_sensor(query);
bayagich 1:5de755abb8d3 16
bayagich 1:5de755abb8d3 17 //locate to print on first line
bayagich 1:5de755abb8d3 18 george.locate(0,0);
bayagich 1:5de755abb8d3 19 george.printf("%i %i %i", query[0], query[1], query[2]);
bayagich 1:5de755abb8d3 20
bayagich 1:5de755abb8d3 21 //locate to print on second line
bayagich 1:5de755abb8d3 22 george.locate(0,1);
bayagich 1:5de755abb8d3 23 george.printf("%i %i", query[3], query[4]);
bayagich 1:5de755abb8d3 24
bayagich 1:5de755abb8d3 25 }
bayagich 1:5de755abb8d3 26