Let's Make Robots!

Arduino Codes for Mr. General IR Compound Eye

Hi,

I've downloaded the codes titled "Mr__General_ATmega8_Object_Detect" and I'd need your help in some of the constants definied in the IOPin header file. I've tried searching around, including the datasheet, to no avail. As this is my first time working on a robot, any help would be deeply appreciated.

Do note that I did not purchase the entire Mr. General robot because I just needed the compound eye with the pan kit for object detection and avoidance. I'm using an Arduino Mega for my project.

============================================================

#define IRleft            2  // Compound Eye Left      - analog  input    A2

#define IRright           3  // Compound Eye Right     - analog  input    A3       

#define IRup              4  // Compound Eye Up        - analog  input    A4

#define IRdown            5  // Compound Eye Down      - analog  input    A5

#define IRleds            0  // Compound Eye LEDs      - digital output   D0

 

#define neckleftrightpin  1  // PAN  Servo             - digital output   D1

#define neckupdownpin     2  // TILt Servo             - digital output   D2

#define leftmotorpin      3  // Left  Motor Servo      - digital output   D3

#define rightmotorpin     4  // Right Motor Servo      - digital output   D4

============================================================
Am I right to say that these are the only IO I should be concerned since I just need the codes for the compound eye?
Also, the schematic PDF is very pixelated when I expand it. For the 7 pin header, how should I go about connecting the Pins (#2 to #6) onto the Arduino?
Thank you.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thank you guys.

Might I ask, which Header Pins (#2,3,4,5,6) govern the IRleft, IRright, IRtop & IRbottom? 

OddBot's picture

If you go to the link that Birdmun gave you you will see a schematic diagram. If you click on that link, as it says to do, then you will get a hi-resolution image.

You will then see that J1 has the pin numbers 1-7. Pin 1 has a square pad on the PCB, the rest are round.

You will see that the phototransistors are all numbered (Q1-Q8).

Look at your PCB or the photo in the link provided by Birdmun, you will see for example that Q7 & Q8 are at the top and in the diagram they connect to pin 2. So pin 2 is your analog output for the top sensors.

Now do the same for left, right and bottom sensors.

 

Thanks, Oddbot & Birdmun. Silly of me to miss out on the Q1-8 imprinted on both the pcb and the schematic. 

 

OddBot's picture
Yes, change those pin definitions to suit the wiring of your robot.
birdmun's picture

http://letsmakerobots.com/node/11293?s=l ? There is a link to a nice big image of the schematic for the compound eye there.