A small program for running lights

Publisher:SparklingMelodyLatest update time:2015-08-11 Source: dzsc Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

I haven't written a 51 microcontroller program for a long time. I wrote a small program to practice.

#include //Include header file
#include
#define uchar unsigned char
uchar temp;
void delayms(int ms);


void main()
{
temp=0x01;
P1=temp; //Turn on the first light

while(1)
{
temp=_crol_(temp,1);
delayms(600);
P1=temp;
}

}
void delayms(int ms)
{
int i,j;
for(i=0;i
for(j=0;j<120;j++);
}

Reference address:A small program for running lights

Previous article:General steps for writing interrupt programs for 51 MCU
Next article:Stepper Motor Driver

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号