Z.L.小姐
STC89C52的片子,想用P1口的四个引脚控制四个反光二极管,
第一个灯亮过之后,延时一段时间,第二个亮,以此类推,
当第四个亮过之后就让四个二极管全亮(或全灭),然后保持。
感觉是一个非常简单的程序,但是就是不能实现。
要求不高,实现起来,确实是非常简单。
众网友提供了 C 程序,明显是小题大做了,难怪楼主不采纳。
汇编语言的程序如下:
本程序已经通过检验。
在这里,引用网友的效果图,如下:
素颜~红太狼
Since the introduction of computer-chip technology in society, in every field in a wide range of 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 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, 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 design of this subject at a later time, introduced me to many aspects of the 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 kind of control circuit reliability, flexibility, use the wide-ranging especially suitable for medium-sized cities of traffic lights, neon lights, , it on other similar system has certain significance.
成工1979
#include <>
#include<>
#define uchar unsigned char
uchar j,temp;
void delay(unsigned int ms)
{
uchar t;
while(ms--)
for(t=0;t<123;t++);
}
void main()
{
P1=0xff;
delay(500);
temp=0xfe; //有点怪,led接在
for(j=0;j<4;j++)
{
P1=temp;
delay(500);
temp=_crol_(temp,1);
}
P1=0xff;
while(1);
}
懒癌末期
我是一名多年的单片机工程师,下面的程序你参考一下
效果图
程序如下:
#include<>
#include<>
#define uchar unsigned char
#define uint unsigned int
uint i;
uchar j;
void delay_ms(uint k) //延时子程序
{
for(i=0;i { for(j=0;j<230;j++) { ; } } } main() { uchar a,b; P1=0xfe; delay_ms(500); b=P1; while(1) { for(a=0;a<3;a++) { b=_crol_(b,1); P1=b; delay_ms(500); } P1=0xf0; delay_ms(500); P1=0xfe; delay_ms(500); b=P1; } } 如果你想学习更多单片机和程序的知识,可以看看我整理好的“17个实验学会单片机”,百度一下“17个实验学会单片机”就可以看到在首页了。
农村劳动力外出务工影响因素分析——以西咸新区为例 我指导你 、
选题的目的和意义是着重阐述论文要解决的问题,以及为什么要选择去解决这个问题,和这个问题追求的答案是什么。着重阐述该选题对理论研究的有何贡献。最好具体到对哪一方面
汇编语言要不?要的留个邮箱
毕业设计的意义是什么 高等工科院校的毕业设计是完成教学计划达到本科生培养目标的重要环节。它通过深入实践、了解社会、完成毕业设计任务或撰写论文等诸环节,着重培
1、选题的大小一定要适中,难易要适度........选题的方法。注意两点:一是选题的大小一定要适中,难易要适度。我们从本科生写论文的实践上看,主要有两种情况需要