主函数
#include "stm32f10x.h"
#include "delay.h"
#include "led2.h"
int main(void)
{
int a[4][4]={{1,0,0,0,},{0,1,0,0,},{0,0,1,0,},{0,0,0,1,}};
int i;
delay_init(100);
LED_Init();
while(1)
{
for(i=0;i<4;i++)
{
LED1=a[i][0];
LED2=a[i][1];
LED3=a[i][2];
LED4=a[i][3];
delay_ms(50);
}
LED1=LED2=LED3=LED4=0;
}
}
|