-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLEDFeedback.h
41 lines (37 loc) · 977 Bytes
/
LEDFeedback.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Copyright (c) 2025 Arduino SA
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#pragma once
#include "Arduino.h"
class LEDFeedbackClass {
public:
enum class LEDFeedbackMode {
NONE,
BLE_AVAILABLE,
PEER_CONNECTED,
CONNECTING_TO_NETWORK,
CONNECTED_TO_CLOUD,
ERROR
};
static LEDFeedbackClass& getInstance();
void begin();
void setMode(LEDFeedbackMode mode);
void stop();
void restart();
void update();
private:
LEDFeedbackClass() {};
void turnON();
void turnOFF();
LEDFeedbackMode _mode = LEDFeedbackMode::NONE;
uint32_t _lastUpdate = 0;
uint32_t _count = 0;
bool _ledState = false;
uint16_t _ledPin = 0;
uint32_t* _framePtr = nullptr;
int32_t _ledChangeInterval = 500;
bool stopped = false;
};