登录
首页 » 嵌入式芯片 » PIC SINGLE-CHIP KEYSTROKE TEST

PIC SINGLE-CHIP KEYSTROKE TEST

于 2023-06-16 发布 文件大小:106.35 kB
0 246
下载积分: 2 下载次数: 1

代码说明:

包括仿真电路及C程序,参考《PIC单片机入门和实战》。按键检测原理:PORTB的高4位设置为输入模式,且开启内部若上拉功能,这样,PORTB的高4位就全都是1,也就是按键的列线全是1,而PORTB的低4位全是0,也就是按键的行线全是0。若有按键按下,那么行线和列线就会连通,按键所在的列线的电压就会拉低,变为0。这个时候,读PORTB,低4位仍然为0 ,但是高四位就会有一位也是0。所以if((PORTB & 0xF0)!=0xF0)可以判断按键是否按下,因为如果按下了,高四位就不全为1。按键扫描,低4位依次输出0,而 低4位的另外3位输出1,那么,当输出0的行线,碰到按键按下的列线,就会将列线的电压拉低,这时候,读PORTB,就会得到按键的行列位置,即按键码。如果输出0的行线,未与按键的列线相连,那么高4位仍然全为1。就继续扫描。KeyCode[]数组中,存储了最近几次的按键码,最多可以存储最近8次,更改数组就可以更改存储大小。若多连接几个数码管,就可以依次显示按键的内容,如同计算器一样

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

发表评论

0 个回复

  • LPC2300系列ARM单
    LPC2300系列的ARM7单片机上FAT文件系统源代码,对开发文件系统很有帮助!-LPC2300 family of ARM7 single-chip on the FAT file system source code, file system on the development of very helpful!
    2022-03-24 10:04:42下载
    积分:1
  • MSP430单机测量电阻及在LCM103的显示
    MSP430单片机测量电阻及在LCM103的显示-MSP430 resistivity measurement and display LCM103
    2022-03-21 15:03:13下载
    积分:1
  • _ _ ARM单机TCPIP
    tcpip_mcu_arm
    2022-04-14 09:48:28下载
    积分:1
  • STC12C5410AD单
    STC12C5410AD-是一款功能非常强大的且-兼容C51的单片机。本程序代码采用STC12C5410AD单片机驱动ICL7135双积分的高性能AD芯片。程序经几天调试通过。完全可用。-STC12C5410AD-is a very powerful and- C51-compatible microcontroller. The program code used STC12C5410AD single-chip dual-drive ICL7135 chip integration of high-performance AD. After a few days through the debugging process. Fully available.
    2023-07-17 13:55:02下载
    积分:1
  • arm的C语言教程 无操作系统支持的系统软件,包括系统引导(BOOT) 、驱动程序、动态内存管理、IPO、通信以及应用软件等方面。 本文详细介绍了...
    arm的C语言教程 无操作系统支持的嵌入式系统软件,包括系统引导(BOOT) 、驱动程序、动态内存管理、IPO、通信以及应用软件等方面。 本文详细介绍了嵌入式平台上用C 语言编写系统软件和应用软件的方法。虽然是针对ARM平台介绍的,但基本经验和算法也适 合于其他嵌入式平台的软件设计-arm of the C language tutorial without operating system support for embedded systems software, including system boot (BOOT), driver, dynamic memory management, IPO, communications and application software and so on. This paper describes the embedded platform using C language, system software and application software methods. Although introduced for the ARM platform, but the basic experience and the algorithm is also suitable for other embedded platforms, software design
    2023-04-14 23:20:04下载
    积分:1
  • camera arduino
    摄像机labview et arduino
    2022-05-27 14:20:15下载
    积分:1
  • This paper introduces a system based on the LPC2000 family of processors the ini...
    本文详细的介绍了基于LPC2000系列处理器的系统的初始化过程,并结合具体代码(在附带的程序中)对重映射作了细致的阐述,这些对于正确的理解和开发基于ARM的嵌入式系统具有重要的意义。-This paper introduces a system based on the LPC2000 family of processors the initialization process, combined with a specific code (in the attached program) made a detailed mapping of the re-elaboration of these for a correct understanding and development of ARM-based embedded system has an important significance.
    2022-05-22 16:28:13下载
    积分:1
  • ARM7
    ARM7-s3c44b0x中文资料,对初学ARM的朋友有帮助-ARM7-s3c44b0x Chinese information on the ARM beginner friends help
    2022-11-02 23:55:03下载
    积分:1
  • 实时时钟tc程序设计
    实时时钟rtc程序设计与电路仿真主程序源码
    2022-03-11 22:07:47下载
    积分:1
  • 端点批量传输 eerom的读写 固件自动下载 USB标准请求 GPIF单字节读写 GPIF_FIFO读写 Led显示与键盘扫描等...
    端点批量传输 eerom的读写 固件自动下载 USB标准请求 GPIF单字节读写 GPIF_FIFO读写 Led显示与键盘扫描等-Bulk transfer endpoint eerom automatically download the firmware to read and write USB standard GPIF single-byte read and write requests to read and write GPIF_FIFO scan Led display and keyboard, etc.
    2023-06-17 14:20:06下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载