Refactoring how board control works

This commit is contained in:
2024-08-22 18:17:35 -04:00
parent a29ccbd2c8
commit 48f83eee38
7 changed files with 278 additions and 49 deletions

View File

@@ -7,10 +7,10 @@
#include <Arduino.h>
#include <Adafruit_NeoPixel.h>
#include "Color.h"
#include "Cube.h"
class CubeStack{
public:
namespace CubeStack{
/**
* @brief Construct a new Cube Stack object
* @param ADCPin the pin that the ADC is connected to
@@ -22,31 +22,10 @@ class CubeStack{
* @brief Returns the number of cubes in the stack
* @return the number of cubes in the stack
*/
uint8_t GetNumberCubes();
/**
* @brief Set the led color array and then send the data to the LED strip
* @param colors the array of colors to set the LEDs to
* @param numColors the number of colors in the array
*/
void SetLEDColors(Color * colors, uint8_t numColors);
uint32_t GetNumberCubes(Cube &cube);
/**
* @brief sends the LED data to the LED strip
*/
void SendLEDData();
private:
uint8_t ADCPin;
// we will probably need a pointer to a fastled object here
Adafruit_NeoPixel blockLights;
uint16_t lowPassADCRead{0};
// store the Color of each LED
Color * ledColors;
uint8_t numLEDs;
uint8_t lastStackHeight{0};
};