예제 #1
0
int main(void)
{
 Init44k22();

intb0 = 0; //init static after system reboot
intb1 = 0;//init static after system reboot


INTCONbits.GIE = 1;
INTCONbits.PEIE = 1;

/* Initialize the mTouch library */
//mTouchInit();
/* Call the mTouch callibration function */
//mTouchCalibrate();


 do//Schedule start:
 {
 lightshow(200,2000);
/*
    intb0 = mTouchReadButton(0);
    intb1 = mTouchReadButton(1);

        if (intb0 < 600 && intb0 > 600)
        {
        PORT_BLUE=1;PORT_GREEN=1;PORT_RED=0; //only red on
        }
        else
        {
        PORT_BLUE=1;PORT_GREEN=1;PORT_RED=1; //all leds off
        }

    
    if (intb1 < 600 && intb0 > 600)
        {
        PORT_BLUE=0;PORT_GREEN=1;PORT_RED=1; //only blue on
        }
    else
        {
        PORT_BLUE=1;PORT_GREEN=1;PORT_RED=1; //all off
        }

    if (intb1 < 600 && intb0 < 600)
        {
        PORT_BLUE=1;PORT_GREEN=0;PORT_RED=1; //only green
        }
    else
        {
        PORT_BLUE=1;PORT_GREEN=1;PORT_RED=1; //all off
        }

*/


 }while(1);//~Schedule

    return 0;
}
예제 #2
0
void doFive() { // Five seconds delay with light show
    int nCount = 4200;
    for (int i = 5; i != 0; i--) {
        while (nCount > 0) {
            Beeper = 1;
            __delay_us(100);
            Beeper = 0;
            __delay_us(100);
            nCount--;
        }
        nCount = 4420;
        lightshow();
    }

}
예제 #3
0
int main(void)//p18F #org 0x0200 w.booter {

{
 Init26k20();
 
INTCONbits.GIE = 1;
INTCONbits.PEIE = 1;


 do//Schedule start:
 {
 lightshow(200,2000);




 }while(1);//~Schedule

    return 0;
}//~Schedule (Main)#####################