keybrd library is an open source library for creating custom-keyboard firmware.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Repozitorijs ir arhivēts. Tam var aplūkot failus un to var klonēt, bet nevar iesūtīt jaunas izmaiņas, kā arī atvērt jaunas problēmas/izmaiņu pieprasījumus.

StrobePort_PCA9655E.cpp 1015B

123456789101112131415161718192021222324252627282930313233343536
  1. #include "StrobePort_PCA9655E.h"
  2. /*
  3. configures column port's configuration and output.
  4. */
  5. StrobePort_PCA9655E::StrobePort_PCA9655E(IOEPort& port)
  6. : port(port), configurationByteCommand(port.num + 6), outputByteCommand(port.num + 2) {}
  7. void StrobePort_PCA9655E::begin()
  8. {
  9. Wire.beginTransmission(port.ADDR);
  10. Wire.write(configurationByteCommand);
  11. Wire.write(0); //0=configure as output (for strobe pins and LED)
  12. Wire.endTransmission();
  13. }
  14. /*
  15. pin is bitwise, where pin being strobed is 1.
  16. level is HIGH or LOW.
  17. */
  18. void StrobePort_PCA9655E::write(const uint8_t pin, const bool level)
  19. {
  20. if (level == LOW)
  21. {
  22. port.outputVal &= ~pin; //set pin output to low, do not reset the other pins because LEDs
  23. }
  24. else
  25. {
  26. port.outputVal |= pin; //set pin output to high
  27. }
  28. Wire.beginTransmission(port.ADDR);
  29. Wire.write(outputByteCommand);
  30. Wire.write(port.outputVal);
  31. Wire.endTransmission();
  32. }