blog icon indicating copy to clipboard operation
blog copied to clipboard

led fader

Open DennisXK opened this issue 3 years ago • 0 comments

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); }

DennisXK avatar Apr 11 '21 20:04 DennisXK