i == 0;Compares the value of i to zero, and throws away the result of the comparison (and because i is local to loop() and unitialised, the value of i is indeterminate anyway)
Try i = 0; to assign zero to i.
Better yet, initialise it when and where you define it, at the top of loop().