Pridani stop metody
This commit is contained in:
parent
692a25771a
commit
b8e9092035
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
||||
MIT License Copyright (c) 2019,2020 xPablo.cz
|
||||
MIT License Copyright (c) 2019-2021 xPablo.cz
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
4
library.json
Normal file
4
library.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "WSLed",
|
||||
"version": "0.0.0+20210128092328"
|
||||
}
|
@ -121,7 +121,7 @@ void wsLED::begin(void)
|
||||
}
|
||||
}
|
||||
|
||||
void wsLED::setColor(LEDRGB &color)
|
||||
void wsLED::setColor(LEDRGB color)
|
||||
{
|
||||
|
||||
_color[(_order >> 6) & 7] = color.r;
|
||||
@ -241,3 +241,15 @@ ledstate_t wsLED::getState(void)
|
||||
|
||||
return _ledState;
|
||||
}
|
||||
|
||||
void wsLED::stop(void)
|
||||
{
|
||||
|
||||
if (NOT_A_PIN != _pin) {
|
||||
_handler.detach();
|
||||
_ledState = LED_STOP;
|
||||
_scale = 0xff;
|
||||
setColor(LEDRGB(0, 0, 0));
|
||||
show();
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ protected:
|
||||
|
||||
bool canShow(void);
|
||||
void show(void);
|
||||
void setColor(LEDRGB &color);
|
||||
void setColor(LEDRGB color);
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
portMUX_TYPE _mux = portMUX_INITIALIZER_UNLOCKED;
|
||||
#endif
|
||||
@ -159,6 +159,7 @@ public:
|
||||
void setOrder(int neworder);
|
||||
ledstate_t getState(void);
|
||||
void pulse(LEDRGB color, uint32_t duration);
|
||||
void stop(void);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user