distance sensor 2y0a21

Digital Fiber, Photoelectric, Laser Range, Optical, Temperature, Rotary Encoder, Ultrasonic, Gas, Gyro, Accelerometer, FlexiBend, Flexiforce, Compass......

distance sensor 2y0a21

Postby syahmi » Sat Apr 17, 2010 1:20 pm

can u give me some sample source code for this sensor?my project is when the robot detect a wall it will stop.help me k
syahmi
Freshie
 
Posts: 6
Joined: Fri Apr 16, 2010 11:13 pm

Re: distance sensor 2y0a21

Postby ober » Sat Apr 17, 2010 4:36 pm

You may refer to Cytron DIY project PR23, schematic, sample source code is provided. It uses SHARP distance sensor.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1455
Joined: Wed Apr 15, 2009 1:03 pm

Re: distance sensor 2y0a21

Postby syahmi » Sat Apr 17, 2010 7:34 pm

thnxs...i use 16f877a board to control the robot but i want ask u if we need make a other circuit to connect the sensor with 16f877a or just direct to the pic?
syahmi
Freshie
 
Posts: 6
Joined: Fri Apr 16, 2010 11:13 pm

Re: distance sensor 2y0a21

Postby ober » Mon Apr 19, 2010 8:49 am

Please refer to the schematic provided in PR23, you will learn by understanding it. Yes, for this sensor, is just direct connection for power and analog signal, but you need to connect to analog input pin of PIC.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1455
Joined: Wed Apr 15, 2009 1:03 pm

Re: distance sensor 2y0a21

Postby shahrul » Sun Apr 25, 2010 10:48 pm

That Sharp distance sensor, just program ADC Module in the PIC.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor


Return to Sensor

Who is online

Users browsing this forum: No registered users and 4 guests

cron