Divisor question on 4WD1AUTO.BAS

James:

In the application 4WD1AUTO.BAS for the A4WD1 rover you take ten GP2D12 Sensor readings and then divide by 85. Can you go into some detail about why you chose the number 85?

for temp = 0 to 9
  adin 17, filter(temp)
next
ir_right = 0
for temp = 0 to 9
  ir_right = ir_right + filter(temp)
next
ir_right = ir_right / 85

Thanks in advance, -Migs

Originally, the value was 100, thus giving you the average of the IR readings. I discovered that by increasing or decreasing this value, you can change the robot’s sensitivity, making it turn more or less sharply. Basically, 85 is simply a value derived through trial and error that gave the best results in-house.

Thank you James, I thought it would be something like this. I appreciate your comments. -Migs