89c51 C language software anti-shake button

Publisher:温暖阳光Latest update time:2016-01-12 Source: eefocusKeywords:89c51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The simulation results are as follows:

89c51 <wbr>C language software anti-shake button


#include
sbit SI=P1^4;
sbit LED0=P3^0;

void delay()
{
  unsigned char i,j;
  for(i=0;i<100;i++)
     for(j=0; j<100;j++)
        ;
}

void main()
{
  LED0=0;
  while(1)
  { if(SI==0) 
     {
     delay
        ();     //Delay for a period of time if(SI==0) //Again Confirm if a button is pressed LED0=1;  //When a button is pressed, light up the LED } else { LED0=0; } } }
          
            
     
     
     
           
     
  

Keywords:89c51 Reference address:89c51 C language software anti-shake button

Previous article:Introduction to MCU I2C Bus
Next article:89c51 assembly serial port receiving data

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号