文件名称:STC12C5A60S2_KEY
- 所属分类:
- 单片机(51,AVR,MSP430等)
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2016-05-04
- 文件大小:
- 38kb
- 下载次数:
- 0次
- 提 供 者:
- yush*****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
下载
别用迅雷、360浏览器下载。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
介绍说明--下载内容均来自于网络,请自行研究使用
单个按键扫描程序
1、程序说明:
该例程演示了接在单片机P1端口上的五个按键。
通过程序扫描对应按键端口的电平状态来确定是否该键按下,
通过机械按键按下和松开时有抖动现象,需在程序中适当延时消除抖动,
避免识别到错误信息,该程序同时具有等待按键释放的功能。
2、实验操作
将拨码开关S10的SMG端拨到ON端,表示该端接通。
同时把该拨码开关的其他端置为断开状态,即不拨到ON端。
否则将影响到实验效果。将程序下载到开发板中运行后,
依次按下S2到S6任意一个键,将在数码管上显示相应的键值-Single key scanner
1, program instructions:
This routine demonstrates the five buttons connected to the P1 port on the microcontroller.
Determines whether the key is pressed by the program scan corresponding to the level state of the key port,
By mechanical press and release the button when the jitter phenomenon, the need for appropriate delay in the process of eliminating jitter,
Avoid identifying the error message, and the program has the function of waiting for the release of the key.
2, experimental operation
The dial switch SMG S10 end of the ON to the side, indicating that the end is connected.
At the same time, the other end of the dial switch is in a disconnected state, that is, the switch is not transferred to the ON terminal.
Otherwise, it will affect the experimental results. After the program is downloaded to the development board to run,
In order to press S2 to S6 any key, the corresponding key will display in the digital tube
1、程序说明:
该例程演示了接在单片机P1端口上的五个按键。
通过程序扫描对应按键端口的电平状态来确定是否该键按下,
通过机械按键按下和松开时有抖动现象,需在程序中适当延时消除抖动,
避免识别到错误信息,该程序同时具有等待按键释放的功能。
2、实验操作
将拨码开关S10的SMG端拨到ON端,表示该端接通。
同时把该拨码开关的其他端置为断开状态,即不拨到ON端。
否则将影响到实验效果。将程序下载到开发板中运行后,
依次按下S2到S6任意一个键,将在数码管上显示相应的键值-Single key scanner
1, program instructions:
This routine demonstrates the five buttons connected to the P1 port on the microcontroller.
Determines whether the key is pressed by the program scan corresponding to the level state of the key port,
By mechanical press and release the button when the jitter phenomenon, the need for appropriate delay in the process of eliminating jitter,
Avoid identifying the error message, and the program has the function of waiting for the release of the key.
2, experimental operation
The dial switch SMG S10 end of the ON to the side, indicating that the end is connected.
At the same time, the other end of the dial switch is in a disconnected state, that is, the switch is not transferred to the ON terminal.
Otherwise, it will affect the experimental results. After the program is downloaded to the development board to run,
In order to press S2 to S6 any key, the corresponding key will display in the digital tube
(系统自动生成,下载前可以参看下载内容)
下载文件列表
3、Key单个按键延时扫描实验\Application\Doc\readme.txt
..........................\...........\Header\STC12C5A60S2.H
..........................\...........\Source\main.c
..........................\...........\.tartup\STARTUP.A51
..........................\Key.plg
..........................\Key.uvopt
..........................\Key.uvproj
..........................\Key_uvopt.bak
..........................\Key_uvproj.bak
..........................\Lis\Key.m51
..........................\...\main.lst
..........................\...\STARTUP.lst
..........................\Obj\Key
..........................\...\Key.hex
..........................\...\Key.lnp
..........................\...\Key.plg
..........................\...\main.obj
..........................\...\STARTUP.obj
..........................\...\STARTUP._ia
..........................\Application\Doc
..........................\...........\Header
..........................\...........\Source
..........................\...........\Startup
..........................\Application
..........................\Lis
..........................\Obj
3、Key单个按键延时扫描实验