diff --git a/usermods/EleksTube_IPS/TFTs.h b/usermods/EleksTube_IPS/TFTs.h index c0c35a796..e96299047 100644 --- a/usermods/EleksTube_IPS/TFTs.h +++ b/usermods/EleksTube_IPS/TFTs.h @@ -39,10 +39,7 @@ private: //// BEGIN STOLEN CODE - bool drawBmp(const char *filename, int16_t x, int16_t y) { - // Nothing to do. - if ((x >= width()) || (y >= height())) return(true); - + bool drawBmp(const char *filename) { fs::File bmpFS; // Open requested file on SD card @@ -85,6 +82,9 @@ private: return(false); } + //draw img that is shorter than 240pix into the center + int16_t y = (height() - h) /2; + bool oldSwapBytes = getSwapBytes(); setSwapBytes(true); bmpFS.seek(seekOffset); @@ -108,7 +108,7 @@ private: } } - pushImage(x, y, w, h, (uint16_t *)output_buffer); + pushImage(0, y, w, h, (uint16_t *)output_buffer); setSwapBytes(oldSwapBytes); bmpFS.close(); @@ -146,7 +146,7 @@ public: // Filenames are no bigger than "255.bmp\0" char file_name[10]; sprintf(file_name, "/%d.bmp", digits[digit]); - drawBmp(file_name, 0, 0); + drawBmp(file_name); } } diff --git a/usermods/EleksTube_IPS/bmp/0.bmp b/usermods/EleksTube_IPS/bmp/0.bmp index cd6e6ff57..e7d778560 100644 Binary files a/usermods/EleksTube_IPS/bmp/0.bmp and b/usermods/EleksTube_IPS/bmp/0.bmp differ diff --git a/usermods/EleksTube_IPS/bmp/1.bmp b/usermods/EleksTube_IPS/bmp/1.bmp index b1dbefc7a..209529f9a 100644 Binary files a/usermods/EleksTube_IPS/bmp/1.bmp and b/usermods/EleksTube_IPS/bmp/1.bmp differ diff --git a/usermods/EleksTube_IPS/bmp/2.bmp b/usermods/EleksTube_IPS/bmp/2.bmp index a35e5e293..d94a55d5f 100644 Binary files a/usermods/EleksTube_IPS/bmp/2.bmp and b/usermods/EleksTube_IPS/bmp/2.bmp differ diff --git a/usermods/EleksTube_IPS/bmp/3.bmp b/usermods/EleksTube_IPS/bmp/3.bmp index a7e1f99ed..401961172 100644 Binary files a/usermods/EleksTube_IPS/bmp/3.bmp and b/usermods/EleksTube_IPS/bmp/3.bmp differ diff --git a/usermods/EleksTube_IPS/bmp/4.bmp b/usermods/EleksTube_IPS/bmp/4.bmp index 549138f7d..7b663d8ad 100644 Binary files a/usermods/EleksTube_IPS/bmp/4.bmp and b/usermods/EleksTube_IPS/bmp/4.bmp differ diff --git a/usermods/EleksTube_IPS/bmp/5.bmp b/usermods/EleksTube_IPS/bmp/5.bmp index fd2e05e5b..b27766486 100644 Binary files a/usermods/EleksTube_IPS/bmp/5.bmp and b/usermods/EleksTube_IPS/bmp/5.bmp differ diff --git a/usermods/EleksTube_IPS/bmp/6.bmp b/usermods/EleksTube_IPS/bmp/6.bmp index a74b77ffc..04984b5c0 100644 Binary files a/usermods/EleksTube_IPS/bmp/6.bmp and b/usermods/EleksTube_IPS/bmp/6.bmp differ diff --git a/usermods/EleksTube_IPS/bmp/7.bmp b/usermods/EleksTube_IPS/bmp/7.bmp index f97944206..83d8e9458 100644 Binary files a/usermods/EleksTube_IPS/bmp/7.bmp and b/usermods/EleksTube_IPS/bmp/7.bmp differ diff --git a/usermods/EleksTube_IPS/bmp/8.bmp b/usermods/EleksTube_IPS/bmp/8.bmp index 49a2325c4..565980e89 100644 Binary files a/usermods/EleksTube_IPS/bmp/8.bmp and b/usermods/EleksTube_IPS/bmp/8.bmp differ diff --git a/usermods/EleksTube_IPS/bmp/9.bmp b/usermods/EleksTube_IPS/bmp/9.bmp index 6251afc1d..88cc3004c 100644 Binary files a/usermods/EleksTube_IPS/bmp/9.bmp and b/usermods/EleksTube_IPS/bmp/9.bmp differ diff --git a/usermods/EleksTube_IPS/readme.md b/usermods/EleksTube_IPS/readme.md index ee9c212dc..a510ad6e1 100644 --- a/usermods/EleksTube_IPS/readme.md +++ b/usermods/EleksTube_IPS/readme.md @@ -2,7 +2,7 @@ This usermod allows WLED to run on the EleksTube IPS clock. It enables running all WLED effects on the background SK6812 lighting, while displaying digit bitmaps on the 6 IPS screens. -Code is largely based on https://github.com/SmittyHalibut/EleksTubeHAX by Mark Smith +Code is largely based on https://github.com/SmittyHalibut/EleksTubeHAX by Mark Smith! Supported: - Display with custom bitmaps from filesystem diff --git a/usermods/EleksTube_IPS/usermod_elekstube_ips.h b/usermods/EleksTube_IPS/usermod_elekstube_ips.h index afd0e9efc..242cea212 100644 --- a/usermods/EleksTube_IPS/usermod_elekstube_ips.h +++ b/usermods/EleksTube_IPS/usermod_elekstube_ips.h @@ -2,6 +2,8 @@ #include "TFTs.h" #include "wled.h" +//Large parts of the code are from https://github.com/SmittyHalibut/EleksTubeHAX + class ElekstubeIPSUsermod : public Usermod { private: TFTs tfts; diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 8e937d741..4d08bc144 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -49,7 +49,7 @@ //#define DEFAULT_LED_TYPE TYPE_WS2812_RGB #ifndef PIXEL_COUNTS - #define PIXEL_COUNTS 30 + #define PIXEL_COUNTS DEFAULT_LED_COUNT #endif #ifndef DATA_PINS