ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
WS35Controller.h
Go to the documentation of this file.
1/**
2 * @file WS35Controller.h
3 * @brief Declares the WS35Controller class for managing WS2812-based displays on the Delta, Epsilon, and Sigma Protogen heads.
4 *
5 * This file defines the WS35Controller class, which extends the Controller base class.
6 * It provides functionality for controlling and displaying content on two WS35 WS2812-based displays
7 * designed for the Delta, Epsilon, and Sigma Protogen heads.
8 *
9 * @date 22/12/2024
10 * @author Coela Can't
11 */
12
13#pragma once
14
15#include <stdint.h> // Include for fixed-width integer types.
16#include <OctoWS2811.h> // Include for OctoWS2811 LED library.
17#include "Controller.h" // Include for base controller functionality.
18#include "../Camera/CameraManager/CameraManager.h" // Include for camera management.
19#include "../Camera/Pixels/PixelGroup.h" // Include for pixel group management.
20
21/**
22 * @class WS35Controller
23 * @brief Manages WS2812-based displays for the Delta, Epsilon, and Sigma Protogen heads.
24 *
25 * The WS35Controller class extends the Controller base class to provide specific
26 * functionality for initializing, controlling, and displaying content on WS2812-based
27 * LED displays.
28 */
29class WS35Controller : public Controller {
30private:
31 const int ledsPerStrip = 346; ///< Number of LEDs per strip.
32 int drawingMemory[346 * 6]; ///< Memory buffer for LED data.
33 const int config = WS2811_GRB | WS2811_800kHz; ///< LED configuration: GRB color order and 800kHz signal.
34 OctoWS2811 leds; ///< Instance of OctoWS2811 for controlling the LEDs.
35
36public:
37 /**
38 * @brief Constructs a WS35Controller with specified parameters.
39 *
40 * @param cameras Pointer to the CameraManager for managing camera data.
41 * @param maxBrightness Maximum brightness for the displays.
42 */
44
45 /**
46 * @brief Initializes the WS35Controller and sets up the displays.
47 */
48 void Initialize() override;
49
50 /**
51 * @brief Updates and displays the content on the WS2812 displays.
52 */
53 void Display() override;
54
55 /**
56 * @brief Sets the color of a specific LED on a specific strip.
57 *
58 * @param strip The strip number (0-based).
59 * @param led The LED number (0-based).
60 * @param rgb The RGB color to set.
61 */
62 void SetPixels(uint8_t strip, uint16_t led, RGBColor rgb);
63
64 /**
65 * @brief Sets the maximum brightness for the displays.
66 *
67 * @param maxBrightness The maximum brightness value (0-255).
68 */
69 void SetBrightness(uint8_t maxBrightness) override;
70
71 /**
72 * @brief Sets the maximum accent brightness (not used for this controller).
73 *
74 * @param maxAccentBrightness The maximum accent brightness value (0-255).
75 */
76 void SetAccentBrightness(uint8_t maxAccentBrightness) override;
77};
Declares the Controller base class for managing lighting controllers.
Manages multiple CameraBase objects.
Base class for managing brightness and display operations of lighting controllers.
Definition Controller.h:25
uint8_t maxAccentBrightness
Maximum allowed accent brightness level.
Definition Controller.h:35
uint8_t maxBrightness
Maximum allowed brightness level.
Definition Controller.h:34
CameraManager * cameras
Pointer to the CameraManager for managing camera data.
Definition Controller.h:31
Represents an RGB color and provides methods for manipulation.
Definition RGBColor.h:23
Manages WS2812-based displays for the Delta, Epsilon, and Sigma Protogen heads.
void Initialize() override
Initializes the WS35Controller and sets up the displays.
OctoWS2811 leds
Instance of OctoWS2811 for controlling the LEDs.
void SetPixels(uint8_t strip, uint16_t led, RGBColor rgb)
Sets the color of a specific LED on a specific strip.
void Display() override
Updates and displays the content on the WS2812 displays.
const int config
LED configuration: GRB color order and 800kHz signal.
void SetAccentBrightness(uint8_t maxAccentBrightness) override
Sets the maximum accent brightness (not used for this controller).
int drawingMemory[346 *6]
Memory buffer for LED data.
const int ledsPerStrip
Number of LEDs per strip.
void SetBrightness(uint8_t maxBrightness) override
Sets the maximum brightness for the displays.