Shop OBEX P1 Docs P2 Docs Learn Events
Before I place my order... — Parallax Forums

Before I place my order...

MadriMadri Posts: 1
edited 2008-06-03 12:53 in Robotics
Hallo!

I want to order the Boe-Bot as well as the encoder kit.

I've never used a micro without interrupts and/or timers before and I'm worried that I will not be able to do the following.

Before I just jump in and buy I want to make sure if I will be able to attach 6 Sharp GP2D12 IR sensors as well as be able to use the encoders effectively with the Boe-Bot and still control the motors through PWM???

The idea is to make use of similar sensors as a much larger platform at·my University.

Regards,
Madri

·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-03 12:53
    The GP2D12 has an analog output. You will need a multi-channel analog to digital converter. There are 8-channel ADCs (the ADC0838) that are commonly used with Stamps and that have plenty of examples (schematics and sample code) available.

    The BoeBot uses what are called "continuous motion servos". These use control pulses that are variable width (0.5 to 2.5ms) repeated every 20ms, but they're not considered PWM which usually refers to the use of the duty cycle of a signal to represent an analog value.

    Usually the way this is done is to have a loop in your program that outputs a control pulse every 20ms and to do part of your other processing while the program is "waiting" for the 17ms or so to finish so it can output another control pulse. It's very reasonable to read one ADC channel every 20ms this way and get a set of GP2D12 readings every 120ms.
Sign In or Register to comment.