RBCX
Library for the RB3204-RBCX board with the ESP32 by RoboticsBrno.
Loading...
Searching...
No Matches
RBCXLeds.h
Go to the documentation of this file.
1#pragma once
2
3#include <mutex>
4
5#include "RBCXUtil.h"
6
7#include "rbcx.pb.h"
8
9namespace rb {
10
15enum LedId {
16 L1 = CoprocReq_LedsEnum_L1,
17 L2 = CoprocReq_LedsEnum_L2,
18 L3 = CoprocReq_LedsEnum_L3,
19 L4 = CoprocReq_LedsEnum_L4,
20
25
26 All = L1 | L2 | L3 | L4,
27};
28
30
31class Leds {
32 friend class Manager;
33
34public:
35 void red(bool on = true);
36 void yellow(bool on = true);
37 void green(bool on = true);
38 void blue(bool on = true);
39 void byId(LedId id, bool on = true);
40
41private:
42 Leds();
43 Leds(const Leds&) = delete;
44 ~Leds();
45
46 LedId m_ledsOn;
47 std::mutex m_mutex;
48};
49
50};
#define RBCX_ENUM_IMPL_MASK_OPERATORS(T)
Definition: RBCXUtil.h:33
Definition: RBCXLeds.h:31
The main library class for working with the RBCX board. Call the install() method at the start of you...
Definition: RBCXManager.h:61
Definition: RBCXAngle.cpp:3
LedId
Helper class for controlling the LEDs connected to the expander.
Definition: RBCXLeds.h:15
@ Green
Definition: RBCXLeds.h:21
@ L2
Definition: RBCXLeds.h:17
@ Red
Definition: RBCXLeds.h:23
@ All
Definition: RBCXLeds.h:26
@ L3
Definition: RBCXLeds.h:18
@ L1
Definition: RBCXLeds.h:16
@ L4
Definition: RBCXLeds.h:19
@ Blue
Definition: RBCXLeds.h:24
@ Yellow
Definition: RBCXLeds.h:22