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.
linepos.cpp
00001 #include "mbed.h" 00002 #include "m3pi_ng.h" 00003 #include "DigitalIn.h" 00004 00005 00006 m3pi hue; 00007 00008 00009 00010 float myLine(void) 00011 { 00012 int sensors[5]; 00013 hue.calibrated_sensor(sensors); 00014 float leftSen, rightSen, midSen; 00015 leftSen = sensors[1] / 1000; 00016 rightSen = sensors[3] / 1000; 00017 midSen = sensors[2] / 1000; 00018 return rightSen - leftSen; 00019 } 00020 00021 int linepos() 00022 { 00023 while(1) 00024 { 00025 hue.printf("%f", myLine()); 00026 } 00027 00028 }
Generated on Wed Jul 20 2022 05:27:32 by
1.7.2