You are on page 1of 1

#include<lpc214x.

h>
#include<rtl.h>
#define SELDISP1 0x10000000
#define SELDISP2 0x20000000
unsigned int array_dec[16]={0x003F0000,0x00060000,0x005B0000,0x004F0000,
0x00660000,0x006D0000,0x007D0000,0x00070000,
0x007F0000,0x006F0000,0x00770000};
unsigned int count;
void delay(void)
{
unsigned int i;
for(i=0;i<5000000;i++);
}
__task void task_3(void)
{
while(count<11)
{
IO0DIR = 0x10FF0000;
IO0CLR = 0x20FF0000;
IO0SET = array_dec[count]|SELDISP1;
delay();
count++;
}
for(;;);
}
__task void task_2(void)
{
while(count<6)
{
IO0DIR = 0x20FF0000;
IO0CLR = 0x10FF0000;
IO0SET = array_dec[count]|SELDISP2;
delay();
count++;
}
if(count==6)
{os_tsk_create(task_3,10);}
}
__task void task_1(void)
{
count=0;
while(count<3)
{
IO0DIR = 0x10FF0000;
IO0CLR = 0x20FF0000;
IO0SET = array_dec[count]|SELDISP1;
delay();
count++;
}
if(count==3)
{os_tsk_create(task_2,10);}
}
int main(void)
{
os_sys_init_prio(task_1,10);
}

You might also like