Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

led fader #13

Open
DennisXK opened this issue Apr 11, 2021 · 0 comments
Open

led fader #13

DennisXK opened this issue Apr 11, 2021 · 0 comments

Comments

@DennisXK
Copy link

DennisXK commented Apr 11, 2021

hello, i tried your code. unfortunately it doesn't work.

what do I have to enter where exactly that it works with the arduino uno.

#include <stdint.h>

/**

  • The instance of this class can control single LED.
    • on, off, toggle (any digital pin)
    • brightness (only PWM pins; i.e. for Arduino Uno: 3, 5, 6, 9, 10, 11)
      /
      class BasicLed {
      public:
      BasicLed(uint8_t pin): pin_(pin) {
      pinMode(9, OUTPUT);
      }
      /
      Light the LED up /
      void on(void) {
      digitalWrite(pin_, HIGH);
      }
      /
      Turn the LED off /
      void off(void) {
      digitalWrite(pin_, LOW);
      }
      /
      Toogle LED on/off /
      void toggle(void) {
      digitalWrite(7, !digitalRead(7));
      }
      /
      Set LED brightness from range <0, 255> */
      void setBrightness(uint8_t value) {
      analogWrite(a0, value);
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant