M5Unit-RGB 0.1.0 git rev:b7fdb9a
Loading...
Searching...
No Matches
unit_Neco.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 M5Stack Technology CO LTD
3 *
4 * SPDX-License-Identifier: MIT
5 */
10#ifndef M5_UNIT_RGB_UNIT_NECO_HPP
11#define M5_UNIT_RGB_UNIT_NECO_HPP
12
13#include <m5_utility/button_status.hpp>
14
15#include "unit_WS2812.hpp"
16
17namespace m5 {
18namespace unit {
25class UnitNeco : public UnitWS2812, public m5::utility::button::Status {
26 M5_UNIT_COMPONENT_HPP_BUILDER(UnitNeco, 0x00);
27
28public:
30 UnitNeco() : UnitWS2812(35 /* 35 pixels */)
31 {
32 auto ccfg = component_config();
33 ccfg.max_children = 1; // Can connect 1 Unit
34 component_config(ccfg);
35 }
40 virtual bool begin() override;
45 virtual void update(const bool force = false) override;
46
53 inline bool buttonAvailable() const
54 {
55 return _btn_available;
56 }
57
58private:
59 bool _btn_available{false};
60};
61
62} // namespace unit
63} // namespace m5
64#endif
UnitNeco()
Constructor (35 LEDs)
Definition unit_Neco.hpp:30
virtual void update(const bool force=false) override
Update the button status.
Definition unit_Neco.cpp:48
bool buttonAvailable() const
Whether the button is usable on the current wiring.
Definition unit_Neco.hpp:53
virtual bool begin() override
Begin the unit.
Definition unit_Neco.cpp:23
Top level namespace of M5Stack.
Unit-related namespace.
WS2812 unit for M5UnitUnified.