Let's Make Robots!

help, loop slowing down farther the object is

i need a little help with my coding....for some reason, when i run it it slows down the farther the object in its path, then i bring an object closer the faster it  cycles through the loop and i cant seem to find the reason why

so here is the code 

ignore the functions at the bottom that is for another time when i try to get those to work 

any help will be apprecaited

 

how to get 7493 to work

i have been trying for the last few nights tyring to get my counter to work

the wireing should be correct ,

Vcc-5V

grnd- ground

input a, to pin 9 on the arduino and it is set to a constant 150 PWM

input b - connected to Qa

Qb, Qc Qd, to LEDs

do i need to hook up the R pins?

 i know the PWM works

and there is power going to the chip

but no counting is going on, so any help would be appreciated