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.
You are viewing an older revision! See the latest version
Homepage
About GP2Y0A21YK¶
GP2Y0A21YK is a distance sensor and can be controlled by using the AnalogIn.
The range of this sensor is 10-80cm.
- GP2Y0A21YK of datasheet
https://www.sparkfun.com/datasheets/Components/GP2Y0A21YK.pdf
About sample program¶
This program outputs distance between the object to the terminal.
Please use in the range of 10-80cm because of the sensor specifications.
Even if the distance is less than 10cm, this program outputs the distance to the terminal.