This is an example of how to use the DAC1Mode, DAC1Frequency, DAC1Voltage, and SharedMem01 system constants. It is also an example of how to use the Wait function.
#define NXTCOMM SharedMem01
void PlayNoteStacato(int note, int dur)
{
if (NXTCOMM) {
} else {
}
}
void TwinkleA()
{
}
void TwinkleB()
{
}
task main()
{
while(true) {
while(NXTCOMM != 0)
{
TwinkleA(); if (NXTCOMM == 0) break;
TwinkleB(); if (NXTCOMM == 0) break;
TwinkleB(); if (NXTCOMM == 0) break;
TwinkleA(); if (NXTCOMM == 0) break;
}
}
}