登录
首页 » c » 单片机彩色旋转灯

单片机彩色旋转灯

于 2022-07-15 发布 文件大小:51.91 kB
0 120
下载积分: 2 下载次数: 1

代码说明:

D1~D8 八个发光二极管构成彩色旋转灯,D9~D13 为档位指示灯,一档旋转速度最慢(周期1s,D13 亮),二档较快(周期0.8s,D12 亮),三档更快(周期0.6s,D11 亮),四档再快(周期0.4s,D10 亮),五档最快(周期0.2s,D10 亮)。四个按键KEY0-KEY1用于设定旋转方向为顺时针旋转或者逆时针旋转,KEY2-KEY3 用于增快或则减慢旋转速度。 按键扫描的方式可以采用前面示例程序中的方法:线反转法或行扫描法。可以用汇编语言实现,也可以用C 语言实现。建议如前面示例所示,汇编采用行扫描法,C 语言用线反转法。程序控制流程是:首先初始化设置默认运行参数,然后读取按键,识别键码,并根据键码的不同执行运行参数调整,最后根据当前的运行参数执行发光二极管D1-D8 的轮流旋转。按键的识别中的键码可以根据图3.11 中的连接情况,总结出其键值表,速度的控制通过控制调用延时程序的次数来决定。

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 弹性网络ElasticNet
    使用到的参数跟谈到弹性网络的那一章里头所讲的是一样的, ke 则是终止条件。如果 step 被打勾,则程式在每一步之间会暂停 100毫秒(或其他使用者输入的数值)。如果 Random 被打勾,则程式会以系统时间作为乱数产生器的种子数,否则,就以使用者输入的数( Random 右边那一格)为种子数。 你可以利用 load 来载入推销员问题档与其最佳解,如此便可比较弹性网络所找出来的解与最佳解差了多少。 Central, Radius, and Error 这三个参数的前两个,只影响弹性网络的起使位置和大小,对求解没有影响。第三个参数代表城市与网络点之间的容忍距离,也就是说,如果某城市与某网络点之间的距离,小于容忍距离,那就把这个城市当成是被该网络点所拜访。 按下小 w按钮会将目前的结果与参数值写到“en.out”这个档案。使得我们可以很方便地来比较不同参数的效果。 (use to turn the parameters of the network flexibility chapter Erlitou have said are the same, ke is the termination conditions. If the step was ticking, every step of the program will be suspended between one hundred milliseconds (or other user input value). If Random was ticking, the program will be the system time as the Random Number Generator the seeds, otherwise, Take the user input (which Random right field) for seeds. You can use load to stall contained salesman problem with the optimal solution, so can be more flexible network to find the best solution and the deficit with a number of questions. Central, Radius, and Error these three parameters of the former two, flexible network affects only the starting position and size so that the solution will not be affected. The third parame)
    2020-07-06 08:08:58下载
    积分:1
  • C-program-of-BSS-and-examples-1
    在linux平台下,纯c写的盲信号分离的代码.它采用基于卷积混合的盲信号分离算法,不但可以分离人工合成的混合信号,而且对于真实环境中的卷积混合的语音信号也能够分离.在本程序中,包含了两个测试文件,makefile后便可以直接使用. 另外值得一提的是,压缩包里包含有一些语音处理方面的常用函数.例如fft变换,读取写入wav文件,以及一些常用的一维向量和二维矩阵变换的函数.这些可以直接应用在其他应用程序里去.(Linux platform, the blind signal separation of pure c write code. Blind signal separation algorithm based on convolution mixed, can be separated not only synthetic mixed-signal and voice signal convolution mixed in real environment can separation in the program, contains two test files can directly use the makefile after. Also worth mentioning is that the compressed bundle includes voice processing commonly used functions such as fft transform read write wav file, as well as some of the commonly used one-dimensional vector and two-dimensional matrix transform function. these can be applied directly into other applications.)
    2021-04-10 16:38:59下载
    积分:1
  • qq
    说明:  通讯录指南系统 包括存入姓名,电话,住址等等(communicate system)
    2012-05-07 23:51:07下载
    积分:1
  • mini2440-code2
    国嵌mini2440实验代码,视频实验源代码4部分(Mini2440 development board based on the video test source code Part 4)
    2014-03-05 16:20:25下载
    积分:1
  • DynamicObject
    基于Skyline的c#二次开发程序2-DynamicObject(Based on Skyline' s second development program c#)
    2014-02-17 12:11:13下载
    积分:1
  • gongfenqi
    hfss设计的功分器,结构简单,易于实现,我相信对初学者会游有用( a new creative guide book on how to creat a new kind of antenna,i am sure it is helpful)
    2016-05-14 18:15:27下载
    积分:1
  • 89C55 t6963c control, debugging with the write KEILC
    89C55控制t6963c,已调试 用KEILC写的-89C55 t6963c control, debugging with the write KEILC
    2022-03-07 10:34:54下载
    积分:1
  • 趋势EA
    说明:  趋势EA,不加仓,不网格,每单都带止损止盈,加载周期30分(Trend EA, no warehousing, no grid, stop-loss and stop-profit for each single, loading cycle 30)
    2020-06-25 10:00:01下载
    积分:1
  • K7PIC
    用PIC实现写种子工具,用232协议转换SPI协议实现.(Write-seed with PIC tools, protocol conversion with 232 SPI protocol.)
    2011-07-20 12:27:47下载
    积分:1
  • OFDMA
    calculates BER of BPSK on OFDM
    2014-01-23 22:09:39下载
    积分:1
  • 696516资源总数
  • 106442会员总数
  • 11今日下载