Skip to content

Latest commit

 

History

History
61 lines (50 loc) · 786 Bytes

README.md

File metadata and controls

61 lines (50 loc) · 786 Bytes

2023-LightDance-RPi

playloop

OF

struct Status {
	int r;
	int g;
	int b;
	int a;
};

vector<vector<Status>> frames;

class OpticalFiberController {
	public:
		OpticalFiberController();
		int init(vector<int> map);
		int sendAll(vector<Status> status); // lightall, darkall
};

// logic
while(1) {
	status = findFrame(getTime());
	sendAll(status);
	sleep(5ms);
}

LED

struct Status {
	int r;
	int g;
	int b;
	int a;
};

vector<LEDStatus> stripStatus(size);

class LEDStripController {
	public:
		LEDStripController();
		int init(vector<int> shape);
		int checkReady();
		int sendAll(vector<vector<Status>> status);
};

// logic
while(1) {
	while(checkReady() == 0){
		sleep(1ms);
  }
	status = findFrame(getTime());
	sendAll(status);
	sleep(5ms);
}