keybrd library is an open source library for creating custom-keyboard firmware.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Ce dépôt est archivé. Vous pouvez voir les fichiers et le cloner, mais vous ne pouvez pas pousser ni ouvrir de ticket/demande d'ajout.

LED_Port.h 769B

12345678910111213141516171819202122232425262728
  1. #ifndef LED_PORT_H
  2. #define LED_PORT_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <Wire.h>
  6. #include <LEDInterface.h>
  7. #include <PortInterface.h>
  8. /* An LED_Port object is an I/O expander pin that is connected to an LED indicator light.
  9. Example initialization:
  10. const uint8_t IOE_ADDR = 0x20;
  11. Port_MCP23S17 portA(IOE_ADDR, 0, 1<<0 | 1<<1 );
  12. LED_Port LED_fn(portA, 1<<5);
  13. */
  14. class LED_Port : public LEDInterface
  15. {
  16. private:
  17. PortInterface& refPort;
  18. const uint8_t pin; //bit pattern, 1 is IOE pin to LED
  19. public:
  20. LED_Port(PortInterface& refPort, const uint8_t pin)
  21. : refPort(refPort), pin(pin) {}
  22. virtual void on();
  23. virtual void off();
  24. };
  25. #endif