The problem is when i use 8000 (which equals 8 seconds here) it works completely fine and jumps out the loop, HOWEVER, when i use 8022 the loop goes on forever? how do i fix this problem?
Y is the what is calculated above^^ so if y is 8000, 9000,5000 etc it works but if its 8022 it doesnt.
i have used all the data types for the variables but still doesnt work.
Please read the guides on the first page for help in posting. The code you have posted makes no sense, it is incomplete and shows no reference to the 8000 or the 8022.
One might say that 8000 and/or 8022 won't work because they are both declared as bytes and are larger than 255, but who knows?