1.AT89C51单片机控制流水灯课程设计
/*******************************************************************************
* 标题: ME300系列单片机开发系统演示程序 - LED流水灯 *
;* 硬件: ME300A,ME300S,ME300A+,ME300B *
* 文件: wl001.C *
* 日期: 2004-1-5 *
* 版本: 1.0 *
* 作者: 伟纳电子 - Freeman *
* 邮箱: freeman@willar.com *
* 网站: *
********************************************************************************
* 描述: *
* LED流水灯 *
* *
********************************************************************************
* 跳线设置: *
* ME300A+ JP1 全部短接,JP2短接在3-4端 *
* ME300B JP1 短接,JP2短接在3-4端 *
* *
* *
********************************************************************************
* 【版权】 Copyright(C)伟纳电子 All Rights Reserved *
* 【声明】 此程序仅用于学习与参考,引用请注明版权和作者信息! *
*******************************************************************************/
#include<reg51.h>
#include <intrins.h>
void delayms(unsigned char ms)
// 延时子程序
{
unsigned char i;
while(ms--)
{
for(i = 0; i < 120; i++);
}
}
main()
{
unsigned char LED;
LED = 0xfe;
P0 = LED;
while(1)
{
delayms(250);
LED = _crol_(LED,1); //循环右移1位,点亮下一个LED
P0 = LED;
}
}
2.跪求单片机流水灯论文摘要英文翻译
Since the introduction of computer-chip technology in society, in every field in a wide range of applications.Running light control systems, the microcontroller is replaced by the gear regulating the delay time of old growth rate in future in the heart of this system.Due to the MCU has several benefits: small size, light weight, a single power supply; features, low power consumption and low; and the data transfer, one finds in SCM internal, run fast, uding, high reliability, so single-chip is widely used in measurement and control system, data acquisition, instrumental, Mechatronics product, smart interface, computer communications, as well as single-chip multilevel system, etc.This article is primarily deals with a subject name is single-chip-chip, flowing water and light control, which enables we learned how to use the SCM control our lives in the application of the facility.The design of this subject at a later time, introduced me to many aspects of the SCM.This topic describes in detail by the MCS-89C51 manifold programming the control circuit, it completed the single-chip flowing water and light control features, and gives specific hardware circuits and the appropriate program.This kind of control circuit reliability, flexibility, use the wide-ranging especially suitable for medium-sized cities of traffic lights, neon lights, etc.Rather, it on other similar system has certain significance.。
3.基于单片机的流水灯程序设计
// 功能 :p0口八个灯作3路跑马灯
// 日期 :2007.10.28
// 程序 :阿辉
// 互动 : 有问题可进小组讨论
// 我们将随时关注小组问题及时为你答疑
//
#include
#define uchar unsigned char
#define uint unsigned int
#define led_data P0 //数据口定义
//延时程序
void delay(uint a)
{
uint i,j;
for(i=a;i>0;i--)
{
for(j=4000;j>0;j--)
;
}
}
//主程序
void main()
{
while(1)
{
led_data=0xdb;
delay(5); //延时一段
led_data=0x6d;
delay(5); //延时一段
led_data=0xb6;
delay(5); //延时一段
}
}
;* 功能 :p0口八个灯作3路跑马灯
;* 日期 : 2007.10.28
;* 程序 :阿辉
;* 互动 : 有问题可进小组讨论
;* 我们将随时关注小组问题及时为你答疑
LED_DATA EQU P0 ;数据口定义
ORG 0000H
LJMP MAIN
ORG 030H
MAIN: MOV LED_DATA,#0DBH ;11011011--零为亮
ACALL DELAY ;延时一段
MOV LED_DATA,#06DH ;01101101
ACALL DELAY ;延时一段
MOV LED_DATA,#0B6H ;10110110
ACALL DELAY ;延时一段
AJMP MAIN ;跳转回主程序
DELAY: MOV R7,#255 ;延时子程序
D1: MOV R6,#255
D2: DJNZ R6,D2
DJNZ R7,D1
RET
END
4.AT89C51单片机控制流水灯课程设计
/******************************************************************************** 标题: ME300系列单片机开发系统演示程序 - LED流水灯 *;* 硬件: ME300A,ME300S,ME300A+,ME300B ** 文件: wl001.C ** 日期: 2004-1-5 ** 版本: 1.0 ** 作者: 伟纳电子 - Freeman ** 邮箱: freeman@willar.com ** 网站: ********************************************************************************** 描述: ** LED流水灯 ** ********************************************************************************** 跳线设置: ** ME300A+ JP1 全部短接,JP2短接在3-4端 ** ME300B JP1 短接,JP2短接在3-4端 ** ** ********************************************************************************** 【版权】 Copyright(C)伟纳电子 All Rights Reserved ** 【声明】 此程序仅用于学习与参考,引用请注明版权和作者信息! ********************************************************************************/#include
5.用89C51单片机设计一个流水灯
#include<reg52.h>;//头文件
sbit duan=P1^6;//定义数码管的段选使能控制端
sbit wei=P1^7;//定义数码管的位选使能控制端
unsigned char led_code[]={0xff,0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};//定义数组
void Delay_ms(unsigned int x);//子函数声明
void Delay_ms(unsigned int x)
{
unsigned int i,j;
for(i=0;i<x;i++)
for(j=0;j<114;j++);
}
void main()
{
duan=0;//关闭数码管的段选信号
wei=0;//关闭数码管的位选信号
P=0xff;//将所有LED熄灭
while(1) //一般来讲,一个主函数里一般都要包含一个死循环来防止程序跑飞。
{
int i;
if(i<9)
{
P0=led_code[i];//将数组中的值依次赋给P0
Delay_ms(50);//延时500ms
i++;//i自?
}
else
i=0;//如果>9将i清零,使之循环
}
}
6.51单片机流水灯设计思想
用移位的方法,逐一给低电平。
#include<reg52.h>
#define uint unsigned int
#define uchar unsigned char
void delayms(uint xms)
{
uint i,j;
for (i=xms;i>0;i--)
for(j=110;j>0;j--);
}
uchar a;
void main()
{
a=0xff;
while(1)
{
P1=a;
delayms(200);
a=a>>1;
}
}
7.51单片机流水灯设计思想
用移位的方法,逐一给低电平。
#include<reg52.h>
#define uint unsigned int
#define uchar unsigned char
void delayms(uint xms)
{
uint i,j;
for (i=xms;i>0;i--)
for(j=110;j>0;j--);
}
uchar a;
void main()
{
a=0xff;
while(1)
{
P1=a;
delayms(200);
a=a>>1;
}
}
转载请注明出处众文网 » 51单片机爱心流水灯毕业论文(AT89C51单片机控制流水灯课程设计)