int yields a range of -32,768 to 32,767. You might want to consider unsigned long.
You can also simplify the math formula that you gave.
int eq = ((16*10^6)/(2*8*500))-1;
int eq = ((16*10^6)/(16 * 500))-1;
int eq = ((1 * 10^6 / 500))-1;
int yields a range of -32,768 to 32,767. You might want to consider unsigned long.
You can also simplify the math formula that you gave.
int eq = ((16*10^6)/(2*8*500))-1;
int eq = ((16*10^6)/(16 * 500))-1;
int eq = ((1 * 10^6 / 500))-1;