#include <reg45.h>

void delay(unsigned int t) { unsigned int i, j; for(i=0;i<t;i++) for(j=0;j<125;j++); }

void main() { while(1) { P1 = 0x00; // 关闭LED1 delay(200); // 延时200ms P1 = 0x01; // 打开LED1 delay(200); // 延时200ms } }

reg45h编写一个c语言程序使发光二极管led1以大约200ms的时间间隔闪烁

原文地址: https://www.cveoy.top/t/topic/chf4 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录