增加led两个实验代码
This commit is contained in:
parent
914d2dac24
commit
1da2d22ee8
13
src/main.c
13
src/main.c
@ -11,6 +11,7 @@
|
||||
#include "public.h"
|
||||
#include "uart.h"
|
||||
#include "stdio.h"
|
||||
#include "led.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名 : main
|
||||
@ -23,9 +24,19 @@ void main(void)
|
||||
|
||||
uart_init(0XFA);//波特率为9600
|
||||
|
||||
u8 i = 0x01;
|
||||
while(1)
|
||||
{
|
||||
{
|
||||
// 实验一:点亮LED
|
||||
// led_all_on();
|
||||
// delay_ms(1000);
|
||||
// led_all_off();
|
||||
// delay_ms(1000);
|
||||
// 实验二:流水灯
|
||||
LED = ~i;
|
||||
i = rotate_left(i,1);
|
||||
delay_ms(1000);
|
||||
|
||||
printf("Hello,world!\r\n");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user