盾怪网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

间谍游戏:用Arduino制作硬件键盘记录器

时间:2024/5/26作者:未知来源:盾怪网教程人气:

[摘要]defined(__AVR_ATmega644__) // Sanguino #defineCORE_INT0_PIN 10 #defineCORE_INT1_PIN 11 #defineCORE_...
defined(__AVR_ATmega644__) // Sanguino #defineCORE_INT0_PIN 10 #defineCORE_INT1_PIN 11 #defineCORE_INT2_PIN 2 #elifdefined(__AVR_ATmega32U4__) // Leonardo #define CORE_INT0_PIN 3 #define CORE_INT1_PIN 2 #define CORE_INT2_PIN 0 #define CORE_INT3_PIN 1 #else  //ArduinoDuemilanove, Diecimila, LilyPad, Mini, Fio, etc… #defineCORE_INT0_PIN 2 #defineCORE_INT1_PIN 3 #endif #endif #endif   /* *  PS2Keyboard.cpp *  Arduino PS2键盘支持库 *  修改自http://www.pjrc.com/teensy/arduino_libraries/PS2Keyboard.zip *  修改者:b41k3r *  基于GPLv2开源 */   #include"PS2Keyboard.h"   #define BUFFER_SIZE 45 static volatile uint8_tbuffer[BUFFER_SIZE]; static volatile uint8_thead, tail; static uint8_t DataPin; static uint8_tCharBuffer=0; static uint8_tUTF8next=0; static const PS2Keymap_t*keymap=NULL; intCombinationKey=0; //增加了一个参数,用来判定按下的是否是功能键和组合键   voidps2interrupt(void) //读取键盘输入的函数,基本原理同前面的demo程序 {        staticuint8_t bitcount=0;        staticuint8_t incoming=0;        staticuint32_t prev_ms=0;        uint32_tnow_ms;        uint8_t n,val;        val =digitalRead(DataPin);        now_ms =millis();        if (now_ms- prev_ms > 250) {                bitcount=0;                incoming=0;        }        prev_ms =now_ms;        n =bitcount – 1;        if (n <=7) {                incoming

关键词:间谍游戏:用Arduino制作硬件键盘记录器




Copyright © 2012-2018 盾怪网教程(http://www.dunguai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版