keybrd library is an open source library for creating custom-keyboard firmware.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
Tento repozitář je archivovaný. Můžete prohlížet soubory, klonovat, ale nemůžete nahrávat a vytvářet nové úkoly a požadavky na natažení.

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. }