Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: bukowski on December 04, 2007, 12:33:24 PM
-
I cant view the video of the IR Rangefinder upgrade. Does the scanning servo input connect to pin 4 of the ATmega8? (and Im assuming that the rangefinder plugs into pin 27, replacing one of the photoresistors)
Thanks,
-Buk
-
If you look at the main code, it will say which pin it is. You will see one line that reads an analog value from a specific pin and stores that value into a variable.
You can therefore change it to whatever pin you like by changing it in code.
(If you still can't figure it out after looking at the code, Ill tell you)
-
OK, im not going to lie. My programming experience is nil, but I think that you have the rangefinder input going to pin 26 because you have the variable a2dConvert8bit(3) going to PC3. I cant seem to find where the scanning servo gets plugged into.
-
pin 26, yeap thats it.
For the scanning servo, try looking in SoR_Utils.h
hint: servo_scan(scan_angle);
-
Hmmm. I see a line "port_on(portd, 2);"
So im gonna take a leap of faith.
I see one of the pins called PD2, which is pin 4. I'll give that a shot. Im guessing that even if its wrong, I wont really hurt anything.
Sorry for bugging you admin, and thanks for the help.
I think im being overly cautious with this because ive already fried one chip, and i only have one backup, and Ive got to be done by thursday.
-
I had faith in you so thats why I didn't give you the answer directly :)
And I understand your over-cautiousness . . . I've fried chips too, and I often put on safety goggles whenever I turn on a circuit for the first time . . . :P
Anyway, now that you know how to read sensors and command servos in code, you can upgrade with more goodies in the future.