keybrd library is an open source library for creating custom-keyboard firmware.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。

Scanner_Port.cpp 566B

123456789101112131415161718192021
  1. #include "Scanner_Port.h"
  2. /* scan() strobes the row's strobePin and retuns state of port's input pins.
  3. Bitwise variables are 1 bit per key.
  4. */
  5. uint8_t Scanner_Port::scan()
  6. {
  7. uint8_t readState; //bitwise, 1 means key is pressed, 0 means released
  8. //strobe on
  9. refPortWrite.write(strobePin, STROBE_ON);
  10. delayMicroseconds(3); //time to stabilize voltage
  11. //read the port pins
  12. readState = refPortRead.read();
  13. //strobe off
  14. refPortWrite.write(strobePin, STROBE_OFF);
  15. return readState;
  16. }