1.跪求单片机流水灯论文摘要英文翻译
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.。
2.基于单片机的流水灯程序设计
// 功能 :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
3.LED跑马灯的单片机开发板设计
这是我用的铁牛单片机开发板里面的跑马灯程序。不知道能不能给你一些启发。灯是共阳的。给低电平亮。
/************************************************************
类型:流水灯的写法,此程序是最原始的写法。
现象:发光二极管从左到右依次点亮。
编写:铁牛电子
时间:2009.3
修改:无
【版权】Copyright(C)铁牛电子 All Rights Reserved
【声明】此程序仅用于学习与参考,引用请注明版权和作者信息!
************************************************************/
#include<reg52.h> //52单片机头文件,一般不要改动,里面包含特殊功能寄存器的定义
#define uchar unsigned char //将unsigned char定义为uchar,简化输写。提高编程速度
#define uint unsigned int //将unsigned char定义为uint,简化输写。提高编程速度
uchar code table[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f}; //定义八个灯的工作状态。
/*延时子程序*/
void delay(uint time)
{
while(--time); //当time的值为非0时,执行空语句。当time为0时,跳出while语句。
}
/*主程序*/
void main()
{
uchar i; //定义一个无符号字符变量。
while(1) //做一个死循环,让程序永远在while下面的大括号里面运行。
{
for(i=0;i<8;i++) //for语句判断条,i<8成立时,执行大括号里面程序
{
P2=table[i]; //P2口对应取值,八个灯的状态
delay(10000); //延时子程序调用
}
}
}
4.求单片机的流水灯的课程设计
------------------------------------------------*/
#include<reg52.h>; //包含头文件,一般情况不需要改动,头文件包含特殊功能寄存器的定义
sbit WEI=P2^7; //数码管位控制脚
sbit DUAN=P2^6; //数码管段控制脚
void Delay(unsigned int t); //函数声明
/*------------------------------------------------
主函数
------------------------------------------------*/
void main (void)
{
unsigned char i; //定义一个无符号字符型局部变量 i 取值范围 0~255
Delay(50000);
WEI=0; //位锁存置0电平,防止LED亮的时候数码管亮
DUAN=0;
while(1)
{
P0=0X00;
Delay(50000);
P0=0Xfe;}
//重新赋初始值
//主循环中添加其他需要一直工作的程序
}
}
/*------------------------------------------------
延时函数,含有输入参数 unsigned int t,无返回值
unsigned int 是定义无符号整形变量,其值的范围是
0~65535
------------------------------------------------*/
void Delay(unsigned int t)
{
while(--t);
}
一楼说错了 是并联。这是程序,自己拍照。
转载请注明出处众文网 » 单片机流水灯毕业论文