keybrd library is an open source library for creating custom-keyboard firmware.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
このリポジトリはアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュや、課題・プルリクエストのオープンはできません。

LED_Port.h 750B

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