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.
Dependencies: mbed-rtos mbed QEI
Fork of ICRSEurobot13 by
AvoidDstSensor.h
00001 #include "mbed.h" 00002 00003 class AvoidDstSensor{ 00004 private: 00005 AnalogIn ain; 00006 00007 public: 00008 AvoidDstSensor(PinName analoginpin) : ain(analoginpin){} 00009 00010 float Raw(){return ain;} 00011 00012 float Distanceincm(){ 00013 float d = ((1.0f/ain)-0.5f)*(1.0f/0.11f); 00014 d = (d < 10 || d > 50)? -1:d; 00015 return d; 00016 } 00017 };
Generated on Tue Jul 12 2022 18:57:56 by
1.7.2
