refactoring
This commit is contained in:
@@ -1,8 +1,3 @@
|
|||||||
struct Cursor {
|
#include "structs.h"
|
||||||
unsigned short x;
|
|
||||||
unsigned short y;
|
|
||||||
|
|
||||||
Cursor() : x(0), y(0) {}
|
Cursor cursor1;
|
||||||
};
|
|
||||||
|
|
||||||
Cursor cursor1;
|
|
||||||
|
|||||||
@@ -16,26 +16,12 @@
|
|||||||
#define PANEL_PIXEL_COUNT 16
|
#define PANEL_PIXEL_COUNT 16
|
||||||
#define PANEL_COUNT 3
|
#define PANEL_COUNT 3
|
||||||
#define NUMPIXELS PANEL_PIXEL_COUNT*PANEL_PIXEL_COUNT*PANEL_COUNT
|
#define NUMPIXELS PANEL_PIXEL_COUNT*PANEL_PIXEL_COUNT*PANEL_COUNT
|
||||||
#define TEXT_BUFFOR_SIZE 64
|
|
||||||
|
|
||||||
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
|
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
|
||||||
|
|
||||||
ScrollableTextData scrollableTexts[4] = {0};
|
|
||||||
unsigned char scrollableTextsCount = 0;
|
|
||||||
char rightTextBuffor[TEXT_BUFFOR_SIZE] = {0};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void writeSmallScrollabreTextInBuffor(char (*text)[TEXT_BUFFOR_SIZE + 1], pos_y = 0) {
|
|
||||||
for (unsigned char i = 0; i < TEXT_BUFFOR_SIZE; i++) {
|
|
||||||
if (text[i]) {
|
|
||||||
unsigned char text_iterator
|
|
||||||
while()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
|
||||||
|
|||||||
+5
-9
@@ -1,5 +1,9 @@
|
|||||||
|
#include "structs.h"
|
||||||
|
|
||||||
unsigned char saved_images_count = 0;
|
unsigned char saved_images_count = 0;
|
||||||
|
|
||||||
|
Cursor cursor1;
|
||||||
|
|
||||||
uint32_t saved_imaged[12][16][16] = {
|
uint32_t saved_imaged[12][16][16] = {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
@@ -48,19 +52,11 @@ uint32_t saved_imaged[12][16][16] = {
|
|||||||
0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000
|
0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
0xFF000000, 0xFF000000, 0xunsigned FF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000
|
0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ScrollableTextData {
|
|
||||||
unsigned short pos_x;
|
|
||||||
unsigned short pos_y;
|
|
||||||
unsigned char width;
|
|
||||||
bool isSmall;
|
|
||||||
ScrollableTextData() : pos_x(0), pos_y(0), width(0), isSmall(false) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
void setPixel(unsigned short x, unsigned short y, uint32_t color) {
|
void setPixel(unsigned short x, unsigned short y, uint32_t color) {
|
||||||
if (x % 2 == 1)
|
if (x % 2 == 1)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-7
@@ -1,19 +1,13 @@
|
|||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#include <WebServer.h>
|
#include <WebServer.h>
|
||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
|
#include "structs.h"
|
||||||
|
|
||||||
const char* ssid = "PPIA";
|
const char* ssid = "PPIA";
|
||||||
const char* password = "pawelpdaldonejta";
|
const char* password = "pawelpdaldonejta";
|
||||||
|
|
||||||
WebServer server(80);
|
WebServer server(80);
|
||||||
|
|
||||||
// Declare the new_image buffer to temporarily store uploaded image
|
|
||||||
struct Pixel {
|
|
||||||
unsigned short x;
|
|
||||||
unsigned short y;
|
|
||||||
uint32_t color;
|
|
||||||
};
|
|
||||||
|
|
||||||
Pixel new_image[16][16];
|
Pixel new_image[16][16];
|
||||||
|
|
||||||
void handleRoot() {
|
void handleRoot() {
|
||||||
|
|||||||
Reference in New Issue
Block a user