• 大小: 62KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-12
  • 语言: 其他
  • 标签: 单片机  

资源简介

20多个STC12的例程,TXT文档,,,,/*功能:点亮LED*/ /*更新时间:2017.4.11*/ /*开发板:CYHX-22*/ #include //添加STC12头文件 sbit LED=P2^2; //LED引脚定义 int main() //主函数 { LED=0; //置低电平,点亮LED灯 while(1); //while(1)循环 }

资源截图

代码片段和文件信息

/*功能:独立按键+LED*/
/*更新:2017.3.16*/
#include//添加STC12头文件
#include//添加库文件

sbit LED=P3^3;//LED引脚定义 
sbit SW1=P3^5;//独立按键定义

int main()//主函数
{
 while(1)//while(1)循环语句
  {
   if(SW1)//判断按键是否按下,若未按下,则熄灭LED;否则点亮LED
    LED=1;//熄灭LED
   else
    LED=0;//点亮LED
  }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-05-11 21:54  STC12C5A60S2_CYHX-22_Rev20170419\
     文件         238  2017-04-11 14:03  STC12C5A60S2_CYHX-22_Rev20170419\1-点亮LED.txt
     文件        4698  2017-04-11 14:28  STC12C5A60S2_CYHX-22_Rev20170419\10-AD转换.txt
     文件        4913  2017-04-11 14:30  STC12C5A60S2_CYHX-22_Rev20170419\11-LVD.txt
     文件        4108  2017-04-11 14:31  STC12C5A60S2_CYHX-22_Rev20170419\12-PS2键盘(作为主机).txt
     文件        1172  2017-04-20 09:41  STC12C5A60S2_CYHX-22_Rev20170419\13-串口(通过串口中断接收数据).txt
     文件         801  2017-04-11 14:33  STC12C5A60S2_CYHX-22_Rev20170419\13-串口.txt
     文件        7113  2017-04-11 14:37  STC12C5A60S2_CYHX-22_Rev20170419\14-AT24C02读写.txt
     文件       10247  2017-04-11 14:56  STC12C5A60S2_CYHX-22_Rev20170419\15-NRF24L01接发数据(2个开发板间).txt
     文件       13113  2017-04-11 16:32  STC12C5A60S2_CYHX-22_Rev20170419\15-NRF24L01接收数据(单个开发板间).txt
     文件         977  2017-04-19 09:43  STC12C5A60S2_CYHX-22_Rev20170419\16-Timer0+LED.txt
     文件        4720  2017-04-19 10:07  STC12C5A60S2_CYHX-22_Rev20170419\17-计时器(Timer0计时,LCD1602显示).txt
     文件        1153  2017-04-11 14:05  STC12C5A60S2_CYHX-22_Rev20170419\2-跑马灯.txt
     文件         351  2017-04-11 14:08  STC12C5A60S2_CYHX-22_Rev20170419\3-独立按键+LED.txt
     文件        1777  2017-04-11 14:10  STC12C5A60S2_CYHX-22_Rev20170419\4-矩阵键盘+4个LED.txt
     文件         401  2017-04-11 14:11  STC12C5A60S2_CYHX-22_Rev20170419\5-红外+LED.txt
     文件        3404  2017-04-11 14:21  STC12C5A60S2_CYHX-22_Rev20170419\6-LCD1602(CD4094驱动).txt
     文件        2924  2017-04-13 11:36  STC12C5A60S2_CYHX-22_Rev20170419\6-LCD1602.txt
     文件        3516  2017-04-11 14:24  STC12C5A60S2_CYHX-22_Rev20170419\7-蜂鸣器.txt
     文件        3548  2017-04-11 16:53  STC12C5A60S2_CYHX-22_Rev20170419\8-LCD12864(CD4094驱动).txt
     文件        3086  2017-04-13 11:38  STC12C5A60S2_CYHX-22_Rev20170419\8-LCD12864.txt
     文件         565  2017-04-11 14:27  STC12C5A60S2_CYHX-22_Rev20170419\9-独立按键+继电器.txt
     目录           0  2018-05-11 21:54  STC12C5A60S2_CYHX-22_Rev20170419\STC12C5A60S2 TEST\
     文件        6376  2005-03-22 15:22  STC12C5A60S2_CYHX-22_Rev20170419\STC12C5A60S2 TEST\STARTUP.A51
     文件       14050  2017-03-16 08:53  STC12C5A60S2_CYHX-22_Rev20170419\STC12C5A60S2 TEST\STARTUP.LST
     文件         758  2017-03-16 08:53  STC12C5A60S2_CYHX-22_Rev20170419\STC12C5A60S2 TEST\STARTUP.OBJ
     文件       17733  2017-01-13 10:51  STC12C5A60S2_CYHX-22_Rev20170419\STC12C5A60S2 TEST\STC12C5A60S2.H
     文件        2298  2014-10-22 20:50  STC12C5A60S2_CYHX-22_Rev20170419\STC12C5A60S2 TEST\api.h
     文件        1537  2017-03-16 08:53  STC12C5A60S2_CYHX-22_Rev20170419\STC12C5A60S2 TEST\test
     文件        1330  2017-03-16 08:53  STC12C5A60S2_CYHX-22_Rev20170419\STC12C5A60S2 TEST\test.LST
     文件        3972  2017-03-16 08:53  STC12C5A60S2_CYHX-22_Rev20170419\STC12C5A60S2 TEST\test.M51
............此处省略12个文件信息

评论

共有 条评论