Thanks for your replies, here is what i have done and what i have found. I removed the part of code in setup that set the variables to zero, I commented out the if statement at the end that stopped the servos and ran the program with no objects within four feet of the ping sensors. Below are the following serial monitor results for about fifteen seconds. The results that are zero are the result of the ping sensors not pinging (light did not flash on either sensor). The servos are powered by a separate 4AA battery pack.
22 inRight, 58 cmRight
23 inLeft, 60 cmLeft
dangerThresh=10 rightDistance=58 leftDistance=60
23 inRight, 59 cmRight
24 inLeft, 61 cmLeft
dangerThresh=10 rightDistance=59 leftDistance=61
0 inRight, 0 cmRight
52 inLeft, 133 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=133
8 inRight, 22 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=22 leftDistance=0
81 inRight, 208 cmRight
28 inLeft, 72 cmLeft
dangerThresh=10 rightDistance=208 leftDistance=72
81 inRight, 207 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=207 leftDistance=0
64 inRight, 165 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=165 leftDistance=0
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0
5 inRight, 13 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=13 leftDistance=0
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0
1 inRight, 3 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=3 leftDistance=0
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0
6 inRight, 16 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=16 leftDistance=0
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0
When only using the first if statement used to run the servos and adding a 100ms delay between pings, i get the following results with nothing within 4 feet of the sensors.
12 inRight, 32 cmRight
53 inLeft, 135 cmLeft
dangerThresh=10 rightDistance=32 leftDistance=135
77 inRight, 197 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=197 leftDistance=0
81 inRight, 208 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=208 leftDistance=0
82 inRight, 209 cmRight
25 inLeft, 64 cmLeft
dangerThresh=10 rightDistance=209 leftDistance=64
82 inRight, 209 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=209 leftDistance=0
81 inRight, 208 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=208 leftDistance=0
33 inRight, 85 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=85 leftDistance=0
44 inRight, 113 cmRight
53 inLeft, 135 cmLeft
dangerThresh=10 rightDistance=113 leftDistance=135
63 inRight, 162 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=162 leftDistance=0
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0
82 inRight, 210 cmRight
19 inLeft, 48 cmLeft
dangerThresh=10 rightDistance=210 leftDistance=48
2 inRight, 5 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=5 leftDistance=0
20 inRight, 53 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=53 leftDistance=0
82 inRight, 209 cmRight
1 inLeft, 4 cmLeft
dangerThresh=10 rightDistance=209 leftDistance=4
0 inRight, 0 cmRight
52 inLeft, 133 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=133
114 inRight, 291 cmRight
52 inLeft, 134 cmLeft
dangerThresh=10 rightDistance=291 leftDistance=134
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0
0 inRight, 0 cmRight
0 inLeft, 0 cmLeft
dangerThresh=10 rightDistance=0 leftDistance=0