Things used in this project

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

3D-Printed Prank Vibrating Cup
Easy
  • 1,088
  • 13

Full instructions

The instant your prankee lifts up this 3D-printed cup it starts violently vibrating! The electronics separate from the cup for easy washing.

The Magic Display With Arduino - The Mind Reader
Easy
  • 1,247
  • 5

Full instructions

The Magic Display With Arduino can figure out with a few clues what is your choose on a card with 64 options of numbers, letters or symbols.

Very First Hands On Arduino - Voice Activated LED
Easy
  • 525
  • 8

Full instructions

Use voice command to turn LED on or off.

Get Connected! WiFi Registration Using AP Mode!
Easy
  • 1,189
  • 15

Full instructions

Stop reflashing your devices everytime the WiFi password changes! Learn how to use anduinoWiFi and AP mode to initiate WiFi registration!

Temperature Sensor
Easy
  • 326
  • 5

Full instructions

A photon that measures the temperature and humididty with a DHT 22 sensor and communicates the temperature data to another photon.

Car Blinker
Easy
  • 181
  • 3

Protip

Blink for Vehicles, such as bikes and skates. Easy.

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback