Code: Select all
unsigned long tolerance = (smaller * TOLERANCE_LEVEL) / 1800; // TODO un hard code this. currently 25% tolerance
Divide by 1800 is 56% tolerance which is not great, but it works for my set up as it is now.
em_knaps you might want to try
Code: Select all
unsigned long tolerance = (smaller * TOLERANCE_LEVEL) / 2048;