STC12C5A60S2管脚
使用的开发板
程序代码
/* 工程创建MCU选取,Atmel 89C55 单片机:STC12C5A60S2 晶振:12M 功能:用STC12C5A60S2的P4接口点亮LED 连接说明:LED正极接VCC,负极接到 MCU的9,29,30,31脚 */ #include <STC12C5A60S2.H> sbit LED7=P4^7; sbit LED6=P4^6; sbit LED5=P4^5; sbit LED4=P4^4; void DELAY_MS (unsigned int a) { unsigned int i; while ( --a != 0 ) { for (i=0;i<=600;i++); } } void main (void) { P4SW=0xff; // 如果仅仅是点亮9脚的LED,不需要这一行 LED6=0; LED4=0; while (1) { LED7 = ~LED7; LED6 = ~LED6; LED5 = ~LED5; LED4 = ~LED4; DELAY_MS(200); } }
程序烧写特别说明
效果图
2015年10月2日,没人约,一个人在家,烂透了,唉。
本文出自 “生命不息,折腾不止。” 博客,谢绝转载!
原文地址:http://990487026.blog.51cto.com/10133282/1699919