zoukankan      html  css  js  c++  java
  • 89C51单片机实现的流水灯

    /*******************************************
    Copyright:  2014.02.09.version1.0
    File name: led.c
    Description: 自己做的流水灯89C51
    Author:  lxl
    Version: version1.0
    Date: 2014.02.09
    History: 无
    *********************************************/
    #include <reg51.h>

    /*************************************************
    Function: delay()
    Description: 延时的功能
    Calls: 无
    Called By: main()
    Table Accessed: 无
    Table Updated: 无
    Input: void
    Output: 无
    Return: void 
    Others: 无
    *************************************************/
    void  delay(void)
    {
     int i,j;
     for(i=0;i<255;i++)
      for(j=0;j<255;j++);
    }

    /*************************************************
    Function: main()
    Description: 程序的主函数
    Calls: delay()
    Called By: 无
    Table Accessed: 无
    Table Updated: 无
    Input: void
    Output: 无
    Return: void
    Others: 无
    *************************************************/
    void main(void)
    {
     char led_on=0x01;
     while(1)
     {
      P1=led_on;
      delay();
      led_on=led_on<<1;
      if(led_on==0x0)
       led_on=0x01;
     }
    }

  • 相关阅读:
    序列化
    cookie 和 session
    a 标签提交表单
    SpringBoot使用Easypoi导出excel示例
    PDF操作类库 iText
    HandlerInterceptor
    Fastdfs
    InitializingBean
    CORS CorsFilter
    XMLHttpRequest
  • 原文地址:https://www.cnblogs.com/luxiaolai/p/3541913.html
Copyright © 2011-2022 走看看