asked on
Programming theory deals with the design, implementation, analysis, characterization, and classification of programming languages and their individual features, along with introductory programming concepts like program structure, variable declaration and conditional and looping constructs. Sub-disciplines include the formal semantics of programming languages, type theory, program analysis and transformation, comparative programming language analysis, metaprogramming, domain-specific languages, compiler construction and run-time systems.
TRUSTED BY
What is your problem? Do you receive some compilation error or something else is wrong?
At my first glance I see the following:
In the following code you initialize i with 10 then decrease it with i-- and finally check in the while statement if it is <10. I think you should check in the while statement if i>0 not if i<10
int i=10;
do
{
TMR1IF = 0;
trig = 1; // start trigger pulse
while(!TMR1IF); // wait
trig = 0; // end trigger pulse
TMR1ON = 0; // stop timer
i--;
}
while(i<10);