Loom 4 v4.5
Arduino library for Internet of Things Rapid Prototyping in environmental sensing
Loading...
Searching...
No Matches
Loom_Neopixel.h
1#pragma once
2
3#include "../../../Loom_Manager.h"
4#include "../../../Actuators.h"
5
6#include <Adafruit_NeoPixel.h>
7
8
14class Loom_Neopixel : public Actuator{
15 public:
16
27 Manager& man,
28 const bool enableA0 = false,
29 const bool enableA1 = false,
30 const bool enableA2 = true,
31 const neoPixelType colorType = NEO_RGB
32 );
33
43 const bool enableA0 = false,
44 const bool enableA1 = false,
45 const bool enableA2 = true,
46 const neoPixelType colorType = NEO_RGB
47 );
48
49 /* Initialize the module per the manager */
50 void initialize() override;
51 void package(JsonObject json) override;
52
53 /* Allows for Max control of the neopixel */
54 void control(JsonArray json) override;
55
65 void set_color(const uint8_t port, const uint8_t chain_num, const uint8_t red, const uint8_t green, const uint8_t blue);
66
73 void enable_pin(const uint8_t port, const bool state);
74
75 private:
76 Manager* manInst; // Pointer to a manager
77
78 Adafruit_NeoPixel pixels[3]; // Allows users to control up to 3 different LED strips at once
79
80 bool enabledPins[3]; // Which of the three control pins is enabled
81};
Definition: Actuators.h:19
Definition: Loom_Neopixel.h:14
void set_color(const uint8_t port, const uint8_t chain_num, const uint8_t red, const uint8_t green, const uint8_t blue)
Definition: Loom_Neopixel.cpp:70
void enable_pin(const uint8_t port, const bool state)
Definition: Loom_Neopixel.cpp:89
void control(JsonArray json) override
Definition: Loom_Neopixel.cpp:61
Definition: Loom_Manager.h:18