v3.1.0 - Advanced Control Utilities & Flicker-Free Display Optimizations
๐ MicroTaskX v3.1.0 โ Advanced Control Utilities & Display Optimizations
We are excited to announce the release of MicroTaskX v3.1.0! This version introduces a major overhaul to MTXUtils, transforming it from basic utility functions into a robust, standalone toolset for embedded systems, advanced robotics, automation, and high-performance UI rendering.
This update maintains complete separation of concerns, keeping MTXUtils completely decoupled from the core MicroTaskXKernel scheduler.
๐ What's New in v3.1.0
- ๐ฎ Advanced Control Systems
Anti-Windup PID Controller (computePID): Implement closed-loop control for motors, heaters, or balancing robots safely with integrated integral windup prevention.
Hysteresis Logic (applyHysteresis): Protect physical relays and hardware components from rapid oscillation near threshold limits. - โก High-Speed LCD Drawing & Visual Aesthetics
Flicker-Free Screen Updates (updateScreenSmart): A template-driven differential buffer update that modifies only changed characters on LiquidCrystal / I2C displays, drastically reducing drawing overhead and eliminating annoying screen flashes.
Non-Blocking Typewriter Effect (printTypewriter): Smooth, cinematic text scrolling without blocking the main loop or tasks.
Centered Output Calculator (getCenterOffset): Automatic string centering based on your display's columns.
Visual Progress Bar Generator (getProgressBarString): Instantly render text-based progress bars (e.g., [===== ]). - ๐ Signal Filtering & Data Buffering
True Moving Average Filter (movingAverage): A sliding-window filter to suppress extreme analog noise.
Generic Circular Queue Class (MTXCircularQueue): High-speed, lock-free ring buffer template for smooth hardware communication (e.g., Serial/UART streams).
Signal Edge Detection (isRisingEdge/isFallingEdge): Low-overhead state change monitoring. - ๐งฎ Data Integrity & System Metrics
Dallas/Maxim CRC8 Checksum (computeCRC8): Verify data packets across wireless modules or storage without standard library overhead.
Battery Level Calculator (calculateBatteryPercentage): Hardware-aware voltage scaling using analog pins and resistor dividers.
Time & Hex Formatters: Built-in formatMillisToTime (HH:MM:SS) and byte-to-hex utility conversions.
๐ File Changes & Structural Updates
MTXUtils.h: Upgraded with template structures, MTXButton encapsulation fix, and advanced hardware management methods.
MTXUtils.cpp: Implementation of standard mathematical and logic controllers.
library.json & library.properties: Bumped version metadata to 3.1.0 and appended new control/timing keywords.
๐ป Quick Usage Example
#include <MicroTaskX.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
char currentFrame[2][17] = {" ", " "};
char memoryFrame[2][17] = {" ", " "};
MTXPID speedPID = { 2.5, 0.5, 0.1, 0, 0, 0, 255 };
void setup() {
lcd.init();
}
void loop() {
// 1. Smooth PID calculation
float motorPWM = MTXUtils::computePID(100.0, readEncoder(), speedPID, 0.01);
// 2. Flicker-free UI Rendering
sprintf(currentFrame[0], "PWM Out: %03d ", (int)motorPWM);
MTXUtils::getProgressBarString(16, (motorPWM/255)*100, currentFrame[1]);
MTXUtils::updateScreenSmart<16, 2>(lcd, currentFrame, memoryFrame);
}
๐ฅ Contributors
Special thanks to Moaaz Yahia Shrif for maintaining and evolving the framework architectures.