cc2540闪灯程序!
先下载iar8.3 demo软件。
#include "ioCC2540.h"
void delay()
{unsigned int i;
for(i=0;i<60000;i++)
asm(" nop ");
}
void main()
{ P0SEL =0;
P0DIR=0x01;
P0=0;
while(1)
{P0=0;
delay();
P0=1;
delay();
}
}
#include "ioCC2540.h"
void delay()
{unsigned int i;
for(i=0;i<60000;i++)
asm(" nop ");
}
void main()
{ P0SEL =0;
P0DIR=0x01;
P0=0;
while(1)
{P0=0;
delay();
P0=1;
delay();
}
}
#include "ioCC2540.h"
void delay()
{unsigned int i;
for(i=0;i<60000;i++)
asm(" nop ");
}
void main()
{ P0SEL =0;
P0DIR=0x01;
P0=0;
while(1)
{P0=0;
delay();
P0=1;
delay();
}
}
照片!