LightHub
statusled.h
Go to the documentation of this file.
1 /* Copyright © 2017-2018 Andrey Klimov. All rights reserved.
2 
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 
7  http://www.apache.org/licenses/LICENSE-2.0
8 
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 
15 Homepage: http://lazyhome.ru
16 GIT: https://github.com/anklimov/lighthub
17 e-mail anklimov@gmail.com
18 
19 */
20 #pragma once
21 #include <Arduino.h>
22 
23 #define ledRED 1
24 #define ledGREEN 2
25 #define ledBLUE 4
26 #define ledBLINK 8
27 #define ledFASTBLINK 16
28 #define ledParams (ledRED | ledGREEN | ledBLUE | ledBLINK | ledFASTBLINK)
29 
30 #define ledFlash 32
31 #define ledHidden 64
32 
33 #define pinRED 50
34 #define pinGREEN 51
35 #define pinBLUE 52
36 
37 #define ledDelayms 1000UL
38 #define ledFastDelayms 300UL
39 
40 class statusLED {
41 public:
42  statusLED(uint8_t pattern = 0);
43  void set (uint8_t pattern);
44  void show (uint8_t pattern);
45  void poll();
46  void flash(uint8_t pattern);
47 private:
48  uint8_t curStat;
49  uint32_t timestamp;
50 };
statusLED::poll
void poll()
Definition: statusled.cpp:66
statusLED::statusLED
statusLED(uint8_t pattern=0)
Definition: statusled.cpp:24
statusLED::flash
void flash(uint8_t pattern)
Definition: statusled.cpp:58
statusLED::set
void set(uint8_t pattern)
Definition: statusled.cpp:44
statusLED
Definition: statusled.h:40
statusLED::show
void show(uint8_t pattern)
Definition: statusled.cpp:35