13#include "../ksComponent.h"
37 } bitflags = {
false,
false};
void setEnabled(bool enabled)
Enables or disables the LED.
Definition ksLed.cpp:75
uint32_t blinkLoops
Number of state change cycles (0 for infinite loop).
Definition ksLed.h:32
virtual ~ksLed()
Destructs the component and restores INPUT mode on the assigned pin.
Definition ksLed.cpp:88
uint8_t getPin() const
Returns a pin number assigned to the LED.
Definition ksLed.h:96
bool isBlinking() const
Returns whether LED is currently blinking.
Definition ksLed.cpp:61
bool init(ksApplication *owner) override
Initializes the LED component.
Definition ksLed.cpp:23
uint8_t pin
Pin number assigned to LED.
Definition ksLed.h:29
uint32_t lastBlinkTimeMs
Timestamp of previous state change (milliseconds).
Definition ksLed.h:30
bool driveAsPushPull
True if the LED should be driven as push-pull, otherwise false.
Definition ksLed.h:36
ksLed(uint8_t pin, bool activeLow=false, bool driveAsPushPull=false)
Constructs the LED object.
Definition ksLed.cpp:16
uint32_t blinkIntervalMs
Intervals between state change (0 to disable blinking).
Definition ksLed.h:31
void setDriveAsPushPull(bool driveAsPushPull)
Enables or disables the push/pull driving mode.
Definition ksLed.cpp:66
bool loop(ksApplication *app) override
Executes core of the LED component logic.
Definition ksLed.cpp:32
void setBlinking(uint32_t blinkIntervalMs, uint32_t blinkLoops=0)
Sets LED blinking pattern.
Definition ksLed.cpp:53
bool isEnabled() const
Returns whether the LED is actually enabled.
Definition ksLed.cpp:48
bool activeLow
True if the LED should be active low, otherwise false.
Definition ksLed.h:35
A class that is a base for user-defined application.
Definition ksApplication.h:43
Base component class.
Definition ksComponent.h:51