keybrd library is an open source library for creating custom-keyboard firmware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

LED_AVR.h 599B

1234567891011121314151617181920212223
  1. #ifndef LED_AVR_H
  2. #define LED_AVR_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <LED.h>
  6. /* A LED_AVR object is an AVR pin that is used to power an LED on and off.
  7. DDRx Data Direction Register is configured as output in RowPort_AVR constructor.
  8. */
  9. class LED_AVR: public LED
  10. {
  11. private:
  12. volatile unsigned char& PORT;
  13. const uint8_t pin; //bitwise pin to LED
  14. public:
  15. LED_AVR(volatile unsigned char& PORTx, const uint8_t pin): PORT(PORTx), pin(pin) {}
  16. virtual void on();
  17. virtual void off();
  18. };
  19. #endif