Sorted header and source code into different folder
This commit is contained in:
27
include/image.hpp
Normal file
27
include/image.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef IMAGE_HPP
|
||||
#define IMAGE_HPP
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#define MAXIMUM_PANELSIZE 5
|
||||
#define PANEL_WIDTH 32
|
||||
#define PANEL_HEIGHT 40
|
||||
|
||||
#define IMAGE_WIDTH (PANEL_WIDTH * MAXIMUM_PANELSIZE)
|
||||
#define IMAGE_HEIGHT PANEL_HEIGHT
|
||||
|
||||
class Image
|
||||
{
|
||||
public:
|
||||
uint8_t get_pixel(int x, int y);
|
||||
void set_pixel(int x, int y, uint8_t value);
|
||||
void clear_pixels();
|
||||
|
||||
private:
|
||||
bool check_bounds(int x, int y);
|
||||
|
||||
uint8_t data[IMAGE_WIDTH * IMAGE_HEIGHT];
|
||||
|
||||
};
|
||||
|
||||
#endif
|
28
include/panel.hpp
Normal file
28
include/panel.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef PANEL_HPP
|
||||
#define PANEL_HPP
|
||||
|
||||
#include "image.hpp"
|
||||
|
||||
|
||||
class Panel
|
||||
{
|
||||
public:
|
||||
Panel(uint8_t pData, uint8_t pClock, uint8_t pLoad, int x, int y);
|
||||
void init();
|
||||
void send_image(Image* img);
|
||||
|
||||
private:
|
||||
void clock();
|
||||
void load();
|
||||
void send_block(Image* p, int x, int y);
|
||||
|
||||
uint8_t pinData;
|
||||
uint8_t pinClock;
|
||||
uint8_t pinLoad;
|
||||
|
||||
// position of panel in image
|
||||
int posX;
|
||||
int posY;
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user