Things used in this project

Hardware components:
A000053 iso both1
Arduino Micro & Genuino Micro
×1
SparkFun GP2Y0A02YK0F
×1
Panasonic eca2am101
Capacitor 100 µF
×1

Schematics

basic schematic
Ir bb vzjvobelke

Code

ATmega32u4_IRArduino
/*
*	Author		: Zavala Ortiz Vicente Arturo.
*	language	: .ino
*	Date		: September 12 2014 5:11:12 PM
*	Name		: ATmega32u4_IR.ino
*	Description : GP2Y0A02YK0F IR Distance Sensor (20-150 cm) test distance in Cm and In
*/


#include "TFT.h"
#include "GP2Y0A02YK0F.h"

GP2Y0A02YK0F irSensor;
int cm;

void setup() 
{
  Tft.init();
  irSensor.begin(A0);	//	Assign A0 as sensor pin
}

void loop()
{

  cm = irSensor.getDistanceCentimeter();
  
  Tft._puts("\nDistance : ");
  Tft._print_dec(cm);  
  Tft._puts(" CM");
  
  Tft._puts("\nDistance : ");
  Tft._printdec(cm / 2.54);
  Tft._puts(" IN");

  delay(500); 
  
  Tft.clrscr();
}

Credits

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Voltmeter using Arduino
Easy
  • 302
  • 12

Protip

If you can't find voltmeter at home or at any other place, then this Hack is for you, Go ahead.

Voltmeter using Arduino

Team Next Tech Lab

Save your life with the Building Collapse Monitor
Easy
  • 105
  • 4

Work in progress

Analyse concrete, metal, wood structures for bends and angles and alerts if they have deviated from the original position.

Hackster Live April 2017 Workshop - Optional - Easy Add-on
Easy
  • 83
  • 2

Full instructions

Adapt your home automation project from our March 2017 workshop to be controlled through BLE using the Blynk app on your phone.

near-perfect gyroscope
Easy
  • 483
  • 7

Work in progress

this code lets you make an accelerometor & gyroscope give the best results.

Arduino 101 - Intel Curie Pattern Matching Dress
Easy
  • 2,119
  • 19

Full instructions

A dress with Curie's pattern matching engine on Arduino101 to control the embedded LEDs, which makes constellations show up on the dress.

Arduino Morse Code Machine
Easy
  • 755
  • 11

Full instructions

A simple arduino Morse code machine with a button,led and a buzzer that takes your input and translates it into English while you are typing

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback