Example #1
0
File: main.c Project: xwaynec/eplab
int main()
{
	unsigned char idx;
	unsigned int i = 0;
	store_cpu_rate(16);
	P0_DIR &= ~0x28;
	P0_ALT &= ~0x28;

	rf_init();
	rf_configure(cfg);
	serial_init(19200);	
	eco_page_init();
	
	//long_function(4,6,8,4);

	msg[0] = 0x0A;
	msg[1] = 0x00;
	/* ADDR */
	msg[2] = 0x02;
	msg[3] = 0xA0;
	/* LEN */
	msg[4] = 0x02;
	msg[5] = 0xDD;
	msg[6] = 0xCC;
	
	for(idx = 4; idx > 0; idx--)
	{
		blink_led();		
		mdelay(300);
	}

	mdelay(1000);

	while(1)
	{
		blink4();
		rf_send(dst_addr, 3, msg, 7);
		blink2();
		mdelay(200);	
		blink6();
	}

	return 0;
}
Example #2
0
void randomBlinking()
{
    int randNum = random(10);
    switch(randNum)
    {
        case 0:
            blink1();
            break;
        case 1:
            blink2();
            break;
        case 2:
            blink3();
            break;
        case 3:
            blink4();
            break;
        case 4:
            blink5();
            break;
        case 5:
            blink6();
            break;
        case 6:
            blink7();
            break;
        case 7:
            blink8();
            break;
        case 8:
            blink9();
            break;
        case 9:
            blink10();
            break;
        default:
            break;
    }
}
Example #3
0
void blink_rebirth()
{
    blink10();
    delay(spd);
    blink9();
    delay(spd);
    blink8();
    delay(spd);
    blink7();
    delay(spd);
    blink6();
    delay(spd);
    blink5();
    delay(spd);
    blink4();
    delay(spd);
    blink3();
    delay(spd);
    blink2();
    delay(spd);
    blink1();
    delay(spd);
}