go away spammer

Author Topic: IR Rangefinder Upgrade Question  (Read 2373 times)

0 Members and 1 Guest are viewing this topic.

Offline bukowskiTopic starter

  • Robot Overlord
  • ****
  • Posts: 219
  • Helpful? 0
IR Rangefinder Upgrade Question
« 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

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: IR Rangefinder Upgrade Question
« Reply #1 on: December 04, 2007, 02:29:14 PM »
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)

Offline bukowskiTopic starter

  • Robot Overlord
  • ****
  • Posts: 219
  • Helpful? 0
Re: IR Rangefinder Upgrade Question
« Reply #2 on: December 04, 2007, 04:18:21 PM »
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.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: IR Rangefinder Upgrade Question
« Reply #3 on: December 04, 2007, 09:42:08 PM »
pin 26, yeap thats it.

For the scanning servo, try looking in SoR_Utils.h

hint: servo_scan(scan_angle);

Offline bukowskiTopic starter

  • Robot Overlord
  • ****
  • Posts: 219
  • Helpful? 0
Re: IR Rangefinder Upgrade Question
« Reply #4 on: December 05, 2007, 10:29:05 AM »
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.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: IR Rangefinder Upgrade Question
« Reply #5 on: December 05, 2007, 01:43:14 PM »
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.

 


Get Your Ad Here

data_list