NXC
Version 1.2.1 r5
Main Page
Related Pages
Modules
Data Structures
Files
Examples
All
Data Structures
Files
Functions
Variables
Groups
Pages
alternating_tasks.nxc
This is an example of how to use the
ExitTo
function.
// When run, this program alternates between task A and task B until halted
// by pressing the gray button.
task B();
void
beep(
const
int
tone)
{
PlayTone
(tone,
MS_500
);
Wait
(
SEC_1
);
}
task A()
{
beep(
TONE_C4
);
ExitTo
(B);
}
task B()
{
beep(
TONE_C6
);
ExitTo
(A);
}
task main()
{
// ExitTo(B) would work as well here.
Precedes
(B);
}
Generated by
1.8.2