It's also nice to see that you've learned to add Serial.print() statements to see what is going on.
This might be a stupid question, but how can I use Serial.print on the if statements, if all I have there is functions and no variables?
It's so nice to see comments match the code.
I forgot to change the commentary but I am sure that didn't hinder your ability to understand the code.
Haven't we been down this road? Where is your serial output?
distance: 56
distance: 32
distance: 15
Smallest value 15
Position of smallest 2
distance: 32
distance: 45
distance: 12
Smallest value 12
Position of smallest 2
distance: 35
distance: 55
distance: 67
Smallest value 35
Position of smallest 0
distance: 42
distance: 64
distance: 78
Smallest value 42
Position of smallest 0
distance: 12
distance: 38
distance: 97
Smallest value 12
Position of smallest 0
distance: 16
distance: 59
distance: 34
Smallest value 16
Position of smallest 0
this is my serial output. It does what is suppose to do when it comes to get the values on the array to find the smallest value and the position of it