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

单片机彩色旋转灯

于 2022-07-15 发布 文件大小:51.91 kB
0 126
下载积分: 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 个回复

  • OTM9605A_CPT5.0_MIPI
    用于手机模组中显示屏上,用来点屏的初始化代码(On the display module for mobile phones used to point screen initialization code)
    2021-02-21 14:39:43下载
    积分:1
  • Queens
    Queen problem is solved
    2015-01-09 18:29:54下载
    积分:1
  • 员工管理系统WinForm版
    说明:  窗体应用,仅供参考。 提供源代码说明,VS2015版本,对现在许多学生有用(Form Application Provide source code instructions, VS2015 version, useful for many students today)
    2020-06-18 08:00:02下载
    积分:1
  • GPIO_FLASH
    这是一个利用dsp的gpio口实现不同的功能模块和数字口功能,程序完整可运行(This is a use of the GPIO DSP port to achieve different functions and functions of the function module, the program can run )
    2015-07-09 11:42:30下载
    积分:1
  • 运用历史运动图狂出运动的人
    该程序可以实现将运动的人用方框选出,主要应用运动历史图(MHI)更新背景图,选出运动的人。
    2022-06-16 09:17:11下载
    积分:1
  • Dream_20060804Z
    RO裡面最簡單的外掛 很好用 有地圖顯示(RO The most simple extrapolated good with a map shows)
    2006-12-25 18:45:13下载
    积分:1
  • SendMail
    实现发送邮件功能,可配置收件人、发送内容(Send mail c# c# c# send mail send mail)
    2013-12-05 09:26:52下载
    积分:1
  • s_key
    说明:  基于Skey协议的网络通信。MD5加密算法的运用。(Network communication based on S-key protocol. Application of MD5 encryption algorithm.)
    2020-07-02 20:20:02下载
    积分:1
  • C# windows窗体应用
    C# windows编程容易实现良好的界面布局,本程序定义了两种格式窗体模式,分别为有窗体格式与无窗体格式,简单实现了对windows窗体的调用
    2022-04-29 21:13:55下载
    积分:1
  • SVD
    % 奇异值分解 (sigular value decomposition,SVD) 是另一种正交矩阵分解法;SVD是最可靠的分解法, % 但是它比QR 分解法要花上近十倍的计算时间。[U,S,V]=svd(A),其中U和V代表二个相互正交矩阵, % 而S代表一对角矩阵。 和QR分解法相同者, 原矩阵A不必为正方矩阵。 % 使用SVD分解法的用途是解最小平方误差法和数据压缩。用svd分解法解线性方程组,在Quke2中就用这个来计算图形信息,性能相当的好。在计算线性方程组时,一些不能分解的矩阵或者严重病态矩阵的线性方程都能很好的得到解( Singular value decomposition (sigular value decomposition, SVD) is another orthogonal matrix decomposition method SVD decomposition is the most reliable method, but it takes more than QR decomposition near ten times the computing time. [U, S, V] = svd (A), in which U and V on behalf of two mutually orthogonal matrix, and the S on behalf of a diagonal matrix. And QR decomposition are the same, the original matrix A is no need for the square matrix. The use of SVD decomposition method are used as a solution of least squares error method and data compression. Using SVD decomposition solution of linear equations, in Quke2 on to use this information to calculate the graphics performance quite good. In the calculation of linear equations, some indecomposable matrix or serious pathological matrix of linear equations can be a very good solution)
    2020-12-21 10:29:08下载
    积分:1
  • 696516资源总数
  • 106658会员总数
  • 16今日下载