See the beginning of main.
You have written: -
for(int s=1000;s>100;s+50)
{
sound(s);
delay(50);
}
s+50 has no effect. May be you want to increment the value of s by 50. If so, then you should write s+=50. But that results into another problem, as described below.
The condition is that s should be greater than 100. Initial value of s is 1000, which is greater than 100. This means that initial value satisfies the condition. So far good. But after every loop, you are increasing the value of s by 50. If initial value is >100, then every value will also be >100, because you are increasing the value of s. Don't you think it will result in infinite for loop?
Only thing that can save is that s will become so large that it will not fit within int. Then s will become negative and loop will break. But this is bad programming. Moreover, it is still very time consuming loop. The system will become extremely slow.
So, let me know why you have put that for loop. Then, I will think of alternative.
Edited by akhl - 17 years ago