M5Unit-RGB 0.0.2 git rev:51dfbe6
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 "unit_WS2812.hpp"
14#include "m5_utility/button_status.hpp"
15
16namespace m5 {
17namespace unit {
24class UnitNeco : public UnitWS2812, public m5::utility::button::Status {
25 M5_UNIT_COMPONENT_HPP_BUILDER(UnitNeco, 0x00);
26
27public:
29 UnitNeco() : UnitWS2812(35 /* 35 pixels */)
30 {
31 auto ccfg = component_config();
32 ccfg.max_children = 1; // Can connect 1 Unit
33 component_config(ccfg);
34 }
39 virtual bool begin() override;
41 virtual void update(const bool = false) override;
42
49 inline bool buttonAvailable() const
50 {
51 return _btn_available;
52 }
53
54private:
55 bool _btn_available{false};
56};
57
58} // namespace unit
59} // namespace m5
60#endif
UnitNeco()
Constructor (35 LEDs)
Definition unit_Neco.hpp:29
virtual void update(const bool=false) override
Update the unit.
Definition unit_Neco.cpp:48
bool buttonAvailable() const
Whether the button is usable on the current wiring.
Definition unit_Neco.hpp:49
virtual bool begin() override
Begin the unit.
Definition unit_Neco.cpp:23
Top level namespace of M5Stack.
Unit-related namespace.
WS2812 unit for M5UnitUnified.