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

22
lib/Cube/Cube.cpp Normal file
View File

@@ -0,0 +1,22 @@
#include "Cube.h"
Cube::Cube(uint8_t ADCPin, uint8_t ledPin)
: ADCPin(ADCPin),
ledPin(ledPin)
{
Color black(0,0,0);
this->SetColor(black);
}
Cube::Cube(uint8_t ADCPin, uint8_t ledPin, const Color &color)
: ADCPin(ADCPin),
ledPin(ledPin)
{
this->SetColor(color);
}
void Cube::SetColor(const Color &color){
this->color.red = color.red;
this->color.green = color.green;
this->color.blue = color.blue;
}

21
lib/Cube/Cube.h Normal file
View File

@@ -0,0 +1,21 @@
/**
* @file Cube.h
* @brief An object to store the data of one cube
*/
#pragma once
#include "Color.h"
class Cube{
public:
Cube();
Cube();
void SetColor(const Color &color);
uint16_t lastADCReading{0};
Color color;
bool isOccupied{false};
};