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.
main.cpp
00001 #include "mbed.h" 00002 #include "DistanceMaxSonar.h" 00003 00004 00005 DistanceMaxSonar::DistanceMaxSonar(PinName MaxS): _MaxS(MaxS){ 00006 } 00007 float DistanceMaxSonar::GetInch(){ 00008 float voltVal = _MaxS; 00009 float inch; 00010 inch = voltVal*515.625; 00011 return inch; 00012 } 00013 float DistanceMaxSonar::GetFt(){ 00014 float inch = GetInch(); 00015 float Ft = inch/12.0; 00016 return Ft; 00017 } 00018 float DistanceMaxSonar::Getcm(){ 00019 float inch = GetInch(); 00020 float cm = inch*2.54; 00021 return cm; 00022 } 00023 float DistanceMaxSonar::GetM(){ 00024 float ft = GetFt(); 00025 float M = ft*0.3048; 00026 return M; 00027 }
Generated on Mon Jul 18 2022 22:47:00 by
1.7.2