The most basic flow lamp Proteus simulation diagram including code based on at89c51 microcontroller

Publisher:钱币之歌Latest update time:2022-01-15 Source: eefocusKeywords:at89c51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

#include

#include

void delay(void)

{

   unsigned int i,j;

   for(i=500;i>0;i--)

      for(j=115;j>0;j--);

      }

void main(void)

 { 

   // Write your code here

    unsigned char led ,a ,b ;//Define three variables

    led=0xfe; //led=1111 1110, P0. 0 is on

   while (1)

   {

      P0=led; //Assign the status of LED to the P0 register

      a=led>>7; //Assign the highest bit of led to the lowest bit of a, and the rest are 0;

      b=led<<1;

      led=b|a; //Bitwise OR operation;

      delay();

      }

  }

Keywords:at89c51 Reference address:The most basic flow lamp Proteus simulation diagram including code based on at89c51 microcontroller

Previous article:Proteus simulation of 8255 parallel I/O expansion experiment based on 51 single chip microcomputer
Next article:51 MCU simulation - relay control lighting equipment

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号