Merge pull request #84 from bobbycar-graz/advanced_ble
Control ledstrip animation via ble
This commit is contained in:
@ -8,6 +8,9 @@
|
|||||||
#ifdef FEATURE_BLE
|
#ifdef FEATURE_BLE
|
||||||
#include <NimBLEDevice.h>
|
#include <NimBLEDevice.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef FEATURE_LEDSTRIP
|
||||||
|
#include "ledstrip.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// local includes
|
// local includes
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
@ -241,6 +244,11 @@ void RemoteControlCallbacks::onWrite(NimBLECharacteristic* pCharacteristic)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef FEATURE_LEDSTRIP
|
||||||
|
auto newBlinkAnimation = doc["anim"].as<int16_t>();
|
||||||
|
if (blinkAnimation != newBlinkAnimation) blinkAnimation = newBlinkAnimation;
|
||||||
|
#endif
|
||||||
|
|
||||||
modes::remoteControlMode.setCommand(RemoteCommand{
|
modes::remoteControlMode.setCommand(RemoteCommand{
|
||||||
.frontLeft = doc["fl"].as<int16_t>(),
|
.frontLeft = doc["fl"].as<int16_t>(),
|
||||||
.frontRight = doc["fr"].as<int16_t>(),
|
.frontRight = doc["fr"].as<int16_t>(),
|
||||||
|
Reference in New Issue
Block a user