This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Buzzer after 10s

Am I correct in doing this?

to on buzzer=0xbf;
to off buzzer=0x40;

can i do this?:
this is to detect the sensors

else if((r&0x07)==3)//if it detect anything it will on buzzer
{
        sputCh('O');
        sputCh('F');
        ledVal=ledVal & 0xbf;
         OPORT=ledVal;//to on buzzer
         delayms(100);
         ledVal=ledVal | 0x40;//will off buzzer after 100s
         OPORT=ledVal;
        sputCh(0);
        sputCh(0x0A);
}
else if((r&0x07)==4)//if never detect anything buzzer will off
{
        sputCh('C');
        sputCh('B');
        ledVal=ledVal | 0x40;   /off buzzer
         OPORT=ledVal;
         sputCh(0);
        sputCh(0x0A);

}