Dynamic memory allocation is a process that allows a program to distribute efficiently its memory space in situations of unpredictable events that need to be stored in memory due to unknown inputs[10]. Using dynamic memory allocation, while a program is running, provides the ability to request more memory from the system. If there is enough memory available, the system will grant the program the...
How to convert a number to C string
In certain embedded systems, using the strtol function to convert an integer to a C string may pose challenges. However, with the utilization of the provided C function, one can successfully convert any string to an integer number. While it may not be considered the most optimal solution, it proves beneficial in addressing such issues. This alternative approach can serve as a practical workaround...
Internet-Of-Things Memory Problems
The growth of Internet-of-Things(IoT) solutions creates vast new opportunities for developers of embedded systems by providing capabilities which can be added to just about any physical object including medical devices, household appliances, home automation, industrial controls, even clothing and light bulbs. This collection of billions of end devices, from the tiniest ultra-efficient connected...
How to left-trim a C string
In various instances, there’s a need to eliminate leading white spaces from a C-string. The provided code snippet efficiently accomplishes this task using a straightforward approach. By employing this uncomplicated method, unnecessary white spaces at the beginning of the C-string are effectively stripped away. This simplistic solution proves useful in scenarios where a basic yet effective...
C-strings merging
This handy code snippet plays a crucial role in merging C strings seamlessly. By leveraging the built-in C-string function strcpy, it allows us to effortlessly combine various strings into a single one, all without the hassle of manually managing memory space. The simplicity of this approach ensures efficiency in string concatenation. I t’s worth noting that the implementation of this...
Fuzzy Logic? Why? Where?
Today many household appliances have fuzzy logic built into them to make their use easier. You can find fuzzy logic in shower heads, rice cookers, vacuum cleaners, and just about everywhere. Here is a list of general observations about fuzzy logic: Fuzzy logic is conceptually easy to understand. The mathematical concepts behind fuzzy reasoning are very simple. What makes fuzzy nice is the...
Memory Management Algorithms for MMU-Less Systems
There are several different approaches for memory management that can solve the fragmentation problem on MMU-less embedded systems. Each algorithm is classified according to the way that it finds a free block of the most appropriate size. There are five categories extendedly analyzed in M. Masmano el al. [1], Sun et al. [2] and P. R. Wilson [10] works: Sequential Fit, Segregated Free Lists...
Autonomous Robots and Application Types
Robots are mechanical or virtual artificial agents, usually electro-mechanical machines which are controlled by a computer program or electronic circuitry. There are separated into different categories depending on their functionality. Most popular robots are placed in hazardous places because these robots perform the tasks that humans are not able to access. Some robots(autonomous robots) can...
How to convert a C-string to upper/lowercase
Often, I find myself in situations where I need to convert a string to either uppercase or lowercase. A nifty trick I often employ is leveraging the ASCII code, where each character corresponds to a specific number. The beauty lies in the fact that the uppercase letters (A-Z) and lowercase letters (a-z) are neatly organized into continuous ranges of ASCII values. For instance, a quick visit to...
How to reverse a C string
In this example we delve into a straightforward function designed to reverse a C-string. As we traverse the theoretical realm, it’s crucial to understand that a C string is essentially a character array culminating with the distinctive termination character ‘\0’ at the end of the actual string. To grasp the intricacies, consider that the length of the array housing the actual...