Here you can share completed projects or parts of projects that may be useful to others. You may post files relevant to ZBasic - source code, schematics, etc.
Here is a simple example of how to use a separate task to perform some operation; in this case flip a I/O port bit to sound a buzzer (zero turns on the buzzer). If the buzzer is already on then no action is taken. The example shows how to wake up a sleeping task so that it can start the action right away and then control is passed back to the caller. At a later time the task asynchronously ends the action.
The corresponding annotated timing diagram is shown below. Note that the various sleep periods in this example have been chosen to show how the program works rather than what might be used in reality. For example the buzzer may only be turned on for 250ms rather than 5 seconds. The task sleep time can be set to a very large value because it is woken up when needed by the SoundBuzzerNoWait() routine.