Page 1 of 1

distance sensor 2y0a21

PostPosted: Sat Apr 17, 2010 1:20 pm
by syahmi
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

Re: distance sensor 2y0a21

PostPosted: Sat Apr 17, 2010 4:36 pm
by ober
You may refer to Cytron DIY project PR23, schematic, sample source code is provided. It uses SHARP distance sensor.

Re: distance sensor 2y0a21

PostPosted: Sat Apr 17, 2010 7:34 pm
by syahmi
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?

Re: distance sensor 2y0a21

PostPosted: Mon Apr 19, 2010 8:49 am
by ober
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.

Re: distance sensor 2y0a21

PostPosted: Sun Apr 25, 2010 10:48 pm
by shahrul
That Sharp distance sensor, just program ADC Module in the PIC.