增加led两个实验代码

This commit is contained in:
fengbh 2024-07-15 02:40:56 +08:00
parent 914d2dac24
commit 1da2d22ee8

View File

@ -11,6 +11,7 @@
#include "public.h" #include "public.h"
#include "uart.h" #include "uart.h"
#include "stdio.h" #include "stdio.h"
#include "led.h"
/******************************************************************************* /*******************************************************************************
* : main * : main
@ -23,9 +24,19 @@ void main(void)
uart_init(0XFA);//波特率为9600 uart_init(0XFA);//波特率为9600
u8 i = 0x01;
while(1) 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); delay_ms(1000);
printf("Hello,world!\r\n"); printf("Hello,world!\r\n");
} }
} }