Image Zoom In/out Sample. This program uses GraphicsFramework library and GP2Y0A21YK sensor. Please use distance sensor in the range of 10-30cm.
Dependencies: GR-PEACH_video GraphicsFramework R_BSP mbed-rtos mbed
Fork of RGA_HelloWorld by
About GP2Y0A21YK
GP2Y0A21YK is a distance sensor and can be controlled by using the AnalogIn.
The range of this sensor is 10-80cm.
- Datasheet of GP2Y0A21YK
https://www.sparkfun.com/datasheets/Components/GP2Y0A21YK.pdf
About wiring
| Sensor | GR-PEACH |
| White wire | A0 |
| Orange wire | GND |
| Black wire | 5.0V |
Diff: main.cpp
- Revision:
- 5:ac895a9527ab
- Parent:
- 4:ffbd2a93b02f
- Child:
- 6:6cad61e4a4c1
--- a/main.cpp Fri May 13 06:41:17 2016 +0000
+++ b/main.cpp Fri May 13 07:10:27 2016 +0000
@@ -202,8 +202,8 @@
Display.Graphics_Start(DisplayBase::GRAPHICS_LAYER_0);
lcd_cntrst.write(1.0);
+ int work_height_pos = ZOOM_MAX_NUM;
while (1) {
- int work_height_pos = ZOOM_MAX_NUM;
distance = get_distance();
/* range of use = 10-30[cm] */
if ((distance >= 10) && (distance <= 30)) {
