Obstacle avoiding robot car - code problem

Hi,
This might help.


Tom.. :slight_smile:

juggerHorn:
Rechargeables are nominally 1.2V, which is why servo specs (for example) list voltage requirements of 4.8 to 6, namely 4x rechrageables (@1.2) or 4x non-recheargeables (@1.5).

Nice try but actually the 6V in servo specs is used to mean 5 x rechargable NiCd/NiMH cells. And that's why they work o.k. on 7V+ because that's what 5 x NiMH will show when fully charged.

And anyone wanting to run motors from AA cells would be well advised to use NiCd/NiMH cells as they can generally deliver higher currents than most AA primary cells.

Steve

slipstick:
actually the 6V in servo specs is used to mean 5 x rechargable NiCd/NiMH cells

I stand corrected. But the real point of my post was about where the 5V (ok, 4.8 ) comes from.

Thank you for the advise everyone! I have got the robot to work now. The problem was none other than the sensor itself. It was giving incorrect values and was also interfering the with motor shield pins. What I did was download the REV3 motor shield library so that I don't have to use pins for direction/speed etc., change the sensor, and it started working! I made lots of mistakes but I learned from them so it was worth it! I also know now that current and voltage are different, so thank you JuggerHorn.

Once again thank you for your help, cheers!