keybrd library is an open source library for creating custom-keyboard firmware.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
Dieses Repo ist archiviert. Du kannst Dateien sehen und es klonen, kannst aber nicht pushen oder Issues/Pull-Requests öffnen.

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