LED 一般是恒流操作的,如何改变 LED 的亮度呢?答案就是 PWM 控制。在一定的 频率的方波中,调整高电平和低电平的占空比,即可实现。比如我们用低电平点亮一个 LED 灯,我们假设把一个频率周期分为 10 个时间等份,如果方波中的高低电平占空比是 9:1, 这是就是一个比较暗的亮度,如果方波中高低电平占空比是 10:0,这时,全部是高电平, 灯是灭的。如果占空比是 5:5,就是一个中间亮度,如果高低比是 1:9,是一个比较亮的 亮度,如果高低是 0:10,这时全部是低电平,就是最亮的。 实际上应用中,电视屏幕墙中的几十百万 LED 象素都是这样控制的,而且每一个象素 都有红绿蓝 3 个 LED,每个 LED 可以变化的亮度是几百到几万或者更多的级别,以实现真 彩色的显示。还有在您的手机中,背光灯的亮度如果是可以变化的,也应该是这种工作方式。 目前的城市彩灯也有很多都使用了 LED,需要控制亮度是也是 PWM 控制。 下面来分析我们的例程,在这个例程中,我们将定时器 2 溢出定为 1/1200 秒。每 10 次脉冲输出一个 120HZ 频率。这每 10 次脉冲再用来控制高低电平的 10 个比值。这样,在 每个 1/120 秒的方波周期中,我们都可以改变方波的输出占空比,从而控制 LED 灯的 10 个 级别的亮度。 为什么输出方波的频率要 120HZ 这么高?因为如果频率太低,人眼就会看到闪烁感 觉。一般起码要在 60HZ 以上才感觉好点,120HZ 就基本上看不到闪烁,只能看到亮度的变 化了。 下面请看程序,程序中有比较多的注释: ――――――――――――――――――――――― #define uchar unsigned char //定义一下方便使用 #define uint unsigned int #define ulong unsigned long #include <reg52.h> //包括一个 52 标准内核的头文件 sbit P10 = P1^0; //要控制的 LED 灯 sbit K1= P3^2; //按键 K1 uchar scale;//用于保存占空比的输出 0 的时间份额,总共 10 份 char code dx516[3] _at_ 0x003b;//这是为了仿真设置的 //模拟 PWM 输出控制灯的 10 个亮度级别 void main(void) // 主程序 { uint n; RCAP2H =0xF3; //赋 T2 的预置值,溢出 1 次是 1/1200 秒钟 RCAP2L =0x98; TR2=1; //启动定时器 ET2=1; //打开定时器 2 中断 EA=1; //打开总中断 while(1) //程序循环 { ;//主程序在这里就不断自循环,实际应用中,这里是做主要工作 for(n=0;n<50000;n++); //每过一会儿就自动加一个档次的亮度 scale++; if(scale==10)scale=0; } } //1/1200 秒定时器 2 中断 timer2() interrupt 5 { static uchar tt; //tt 用来保存当前时间在一秒中的比例位置 TF2=0; tt++; if(tt==10) //每 1/120 秒整开始输出低电平 { tt=0; if(scale!=0) //这里加这一句是为了消除灭灯状态产生的鬼影 P10=0; } if(scale==tt) //按照当前占空比切换输出高电平 P10=1; } ―――――――――――――――――― 在主程序中,每延时一段时间,就自动换一个占空比,以使亮度自动变化,方便观察。 编译,运行,看结果。 可以看到,LED 的亮度以每种亮度 1 秒左右不断变化,共有 10 个级别。
上传时间: 2017-11-06
上传用户:szcyclone
Lithium–sulfur (Li–S) batteries with high energy density and long cycle life are considered to be one of the most promising next-generation energy-storage systems beyond routine lithium-ion batteries. Various approaches have been proposed to break down technical barriers in Li–S battery systems. The use of nanostructured metal oxides and sulfides for high sulfur utilization and long life span of Li–S batteries is reviewed here. The relationships between the intrinsic properties of metal oxide/sulfide hosts and electrochemical performances of Li–S batteries are discussed. Nanostructured metal oxides/ sulfides hosts used in solid sulfur cathodes, separators/interlayers, lithium- metal-anode protection, and lithium polysulfides batteries are discussed respectively. Prospects for the future developments of Li–S batteries with nanostructured metal oxides/sulfides are also discussed.
上传时间: 2017-11-23
上传用户:653357637
精度除法函数。 调用函数,并输入被除数、除数和精确到小数点后多少位。即可得到商的整数部分和小数部分。 /*************************精度除法函数********************************/ //======================================================================== // 函数: Void chufa(unsigned long beichushu,unsigned long chushu, unsigned char wei) // 描述: 精度除法 // 参数: unsigned long beichushu, 被除数 // unsigned long chushu, 除数 // unsigned char wei 精确到小数点后多少位 // 返回: 无. // 版本: V1.0, 2017-8-3 //========================================================================
上传时间: 2018-04-16
上传用户:qibao9891
Abstract—In the future communication applications, users may obtain their messages that have different importance levels distributively from several available sources, such as distributed storage or even devices belonging to other users. This scenario is the best modeled by the multilevel diversity coding systems (MDCS). To achieve perfect (information-theoretic) secrecy against wiretap channels, this paper investigates the fundamental limits on the secure rate region of the asymmetric MDCS (AMDCS), which include the symmetric case as a special case. Threshold perfect secrecy is added to the AMDCS model. The eavesdropper may have access to any one but not more than one subset of the channels but know nothing about the sources, as long as the size of the subset is not above the security level. The question of whether superposition (source separation) coding is optimal for such an AMDCS with threshold perfect secrecy is answered. A class of secure AMDCS (S-AMDCS) with an arbitrary number of encoders is solved, and it is shown that linear codes are optimal for this class of instances. However, in contrast with the secure symmetric MDCS, superposition is shown to be not optimal for S-AMDCS in general. In addition, necessary conditions on the existence of a secrecy key are determined as a design guideline.
标签: Fundamental Limits Secure Class on of
上传时间: 2020-01-04
上传用户:kddlas
In recent years, cellular voice networks have transformed into powerful packet-switched access networks for both voice communication and Internet access. Evolving Universal Mobile Telecommunication System (UMTS) networks and first Long Term Evolution (LTE) installations now deliver bandwidths of several megabits per second to individual users, and mobile access to the Internet from handheld devices and notebooks is no longer perceived as slower than a Digital Subscriber Line (DSL) or cable connection. Bandwidth and capacity demands, however, keep rising because of the increasing number of people using the networks and because of bandwidth-intensive applications such as video streaming. Thus, network manufacturers and network operators need to find ways to continuously increase the capacity and performance of their cellular networks while reducing the cost.
标签: BRINGING NETWORKS Beyond and 3G 4G
上传时间: 2020-05-26
上传用户:shancjb
Today’s wireless services have come a long way since the roll out of the conventional voice-centric cellular systems. The demand for wireless access in voice and high rate data multi-media applications has been increasing. New generation wireless communication systems are aimed at accommodating this demand through better resource management and improved transmission technologies.
标签: Radio Cognitive Software Defined
上传时间: 2020-05-26
上传用户:shancjb
Cooperation is not a natural characteristic attributed to humans. The typical human horizon is focused on short-term gains, which might be due to our instinct-driven subconscious occupying a grander importance than we dare to admit [1]. Cooperating with other individuals or entities, however, usually means that short-term losses may translate into long-term gains – something history has proved to hold true but humans for some reason rarely ever understand.
标签: Communications Cooperative
上传时间: 2020-05-27
上传用户:shancjb
It is commonly accepted today that optical fiber communications have revolutionized telecommunications. Indeed, dramatic changes have been induced in the way we interact with our relatives, friends, and colleagues: we retrieve information, we entertain and educate ourselves, we buy and sell, we organize our activities, and so on, in a long list of activities. Optical fiber systems initially allowed for a significant curb in the cost of transmission and later on they sparked the process of a major rethinking regarding some, generation-old, telecommunication concepts like the (OSI)-layer definition, the lack of cross-layer dependency, the oversegmentation and overfragmentation of telecommunica- tions networks, and so on.
上传时间: 2020-05-27
上传用户:shancjb
Cellular communications is one of the fastest growing and most challenging telecom- munication applications ever. Today, it represents a large and continuously increasing percentage of all new telephone subscribers around the world. In the long term, cellular digital technology may become the universal way of communication.
标签: Engineering System GSM
上传时间: 2020-05-27
上传用户:shancjb
The motivation to write about the History of Wireless comes from Auguste Comte (1798-1857), a French philosopher who is termed the father of positivism and modem sociology [Les Maximes d'Auguste Comte (Auguste Comte's Mottos), http://www.membres.lycos.fr/clotilde/l: On ne connaitpas complgtement une science tant qu'on n'en saitpas l'histoire. (One does not know completely a science as long as one does not know its history.)
上传时间: 2020-05-27
上传用户:shancjb