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.
Dependents: IRsensor_sample 2019NHK_A_sensor 200_yotsuba_21
IRsensor.h File Reference
SHARP 2Y0A21を使ったIR距離測定 More...
Go to the source code of this file.
Data Structures | |
| class | IRsensor |
| SHARP 2Y0A21を使ったIR距離測定のクラス More... | |
Detailed Description
SHARP 2Y0A21を使ったIR距離測定
Example :
#include"mbed.h" #include"IRsensor.h" IRsensor ir1(PC_1); Serial pc(USBTX,USBRX,115200); int main() { ir1.startAveraging(255); while(1){ float dis = ir1.getDistance(); float ave_dis = ir1.get_Averagingdistance(); pc.printf("dis:%4.4f[cm]||ave_dis:%4.4f[cm]\n\r",dis,ave_dis); } }
Definition in file IRsensor.h.
Generated on Mon Jul 18 2022 06:21:00 by
1.7.2