Personally I would code the brake to remove throttle up to the point in which the brake is mor than the throttle, then actuated a servo with some form of friction device on the driven axle. That way limiting the amount of additional components required.

Presume you're using some form of pot for the accelerator and brake... So if throttle is on full, apply half brake arduino supplies half throttle, simple really. If throttle is on half, apply full brake, servo actuated to ram on the friction. Simple really.

i guess it should be the same because the throttle and brake are pots so it would work in reverse, full thottle and full brake car will stop, ... same as u said

And to make sure, just programme the full throttle range to 90% of its sweep, then when arduino sees full throttle, it's only 90% in reality, so when 100% brake is applied, it will ALWAYS be a high value than throttle regardless, thus slamming on the brakes.

And to make sure, just programme the full throttle range to 90% of its sweep, then when arduino sees full throttle, it's only 90% in reality, so when 100% brake is applied, it will ALWAYS be a high value than throttle regardless, thus slamming on the brakes.

ahh so you suggest i put instead of 255, about 240 for example ?! but i guess i loose power here for the dc motor :S

Nope. Put 240 on the pot as max, and when the pot hits 240 upwards arduino supplies max power to the motor, but limits the reading to 240, even if its 249. The brake pot is read as is, so 241 on the brake pot would kill power to DC motors completely.

Nope. Put 240 on the pot as max, and when the pot hits 240 upwards arduino supplies max power to the motor, but limits the reading to 240, even if its 249. The brake pot is read as is, so 241 on the brake pot would kill power to DC motors completely.

That way anything where brake > accelerator applies power to servo assisted brake.

Nice and simple and involves less components

well i must experiment this to understand what you really mean because it's been a while i made my program and forgot the logic lol, nevertheless i am a beginner i managed to make a full program with a gearbox like, but the brakes still didn't work with because still didn't get the chip

but the servo i can't use it because the structure of the car i have it wouldn't allow that !! you can check the pictures up in the starting of the topic and if it's not clear i will upload new ones soon

so now i need to do the throttle and brake system,what do i have to do ? where do i have to connect the brake pot ? is it on the enable pin of the chip ? which means brake and throttle are both connected to the pin 1 on the IC ?

Going reverse like everyone suggested here is one solution.. I've used the L293D chip, but never needed a break system.. So I didn't really think about it then.. You can look at how the arduino team did it with their motor shield (L298P)(http://arduino.cc/en/Main/ArduinoMotorShieldR3).. Pins 9 and 8 are coupled to some breaking function for motors A and B.. Looking at the schematic, sending a high or low to the break pin is the same as putting the direction pins on the chip to the same state (both high or low).. You can also look at the logic table for the chip on page 6/13 in the datasheet (http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00000240.pdf)..