Hmmm... Any comments? Looks good... but it does NOT work. I cant figure it out dude... please help!!
It shouldnt be THAT hard and it shoulnt take THAT much code!
PLEASE REPLY ASAP! THX!!!
Have you tried running it through simulation to see what happens ? You can reduce the 250 value to 25, even 10 or 5 while testing so it doesn't take so long to step round the code and see what is happening.
Alternatively you can add additional SERTXD or DEBUG commands within the code so you can trace where the code is going. When you see something happening that is wrong you can 'zoom out' mentally and hopefully figure out why the code got there, work out what caused that.
Your posts were between 03:30 and 07:00 GMT when most Brits, including myself and Technical, would normally be in bed or at least not looking at the forum; srnet is obviously an early riser plus we are fortunate in having an active international membership but there will always be times when response times will be longer.
It also helps yourself to help others to help you; so rather than "doesn't work!" it's best to say what results you get, indicate what it does wrong or similar. That will help people focus in on what could be causing that without having to run the code for themselves. The easier you can make it for others the more likely they are to help. Don't forget that if code looks right to you it may equally look right to others and they may not have the time to investigate more deeply.
Though I haven't run the code it looks like you probably adjust your numbers in a way that the conditional change isn't happening so the 'time' value gets stuck.
Two examples in the following post which show two different ways of doing a increasing and decrementing time period, and there's always FOR-NEXT as well.
The 'flash the LED' code moved to a subroutine for clarity, and once you've done that it can be easier to move away from a single loop to a multi-loop which can provide a simpler solution to a problems.