Example |
#include <stdio.h>
#include "lib.h"
void main( void )
{
int ch, open, connected;
ComOpen( COM12 );
Sound(TSTANDARD, VHIGH, SMEDIUM, SHIGH, 0);
open = TRUE;
connected = FALSE;
for(;;)
{
if(connected != BltIsConnected())
{
connected = BltIsConnected();
Sound(TVLONG, VHIGH, connected ? SHIGH : SLOW, 0);
}
if((ch=getchar()) == TRIGGER_KEY)
{
if(!open)
{
Sound(TSTANDARD, VHIGH, SMEDIUM, SHIGH, 0);
ComOpen( COM12 );
open = TRUE;
}
else
{
PutCom2(COM12, 'X');
}
}
else if(ch == CLR_KEY && open)
{
ComClose(COM12);
Sound(TLONG, VHIGH, SERROR, 0);
connected = open = FALSE;
}
Idle();
}
}
|