Advanced Search
Search Results
341 total results found
Categories of Task Scheduling Algorithms
Several task-scheduling techniques available in a Real-Time Operating System (RTOS) have both benefits and drawbacks depending on the the needs of the system and the nature of the tasks under execution. Among the most often used algorithms are: 1. Run for Com...
Introduction to FreeRTOS
Particularly for IoT uses, FreeRTOS is a well-known open-source RTOS kernel found in embedded systems. FreeRTOS has three basic ideas guiding its design: Simplicity: Simple to grasp and put to use. Portability: It can operate on several different processo...
Practical Sections
Setting Up FreeRTOS on ESP-32 Two cores in ESP-32 let this low-power microcontroller operate: CPU0: Handles BLE, Bluetooth, and Wi-Fi wireless protocols. CPU1: Executes code for user apps. Installing and configuring the ESP-32 Arduino Core: 1. Obtain...
Additional References
[1]“Introduction to RTOS Part 3 - Task Scheduling | Digi-Key Electronics,” www.youtube.com. https://www.youtube.com/watch?v=95yUbClyf3E. [2]“Introduction to RTOS - Solution to Part 3 (Task Scheduling),” DigiKey, 2021. https://www.digikey.com/en/maker/projec...
1. Introduction to Functions
1.1 What are Functions? Functions are self-contained blocks of code that perform specific tasks. They are fundamental building blocks that help organize code, promote reusability, and make programs more modular and maintainable. Benefits of Functions: Code Re...
2. Function Declaration, Definition, and Calling
2.1 Function Anatomy A C function consists of several parts: return_type function_name(parameter_list) { // Function body // Local variables // Statements return value; // (if return_type is not void) } Components: Return Type: Data type of t...
3. Parameters and Arguments
3.1 Terminology Parameters (Formal Parameters): Variables in the function definition Arguments (Actual Parameters): Values passed when calling the function // 'a' and 'b' are parameters int add(int a, int b) { return a + b; } int main() { int x = 5,...
4. Return Statement
4.1 Basic Return Usage The return statement serves two purposes: Return control to the calling function Return a value (optional, depending on function type) // Function that returns a value int get_maximum(int a, int b) { if (a > b) { return a; ...
5. Variable Scope and Lifetime
5.1 Local Variables Variables declared inside a function are local to that function: Scope: Only accessible within the function where they're declared Lifetime: Created when function is called, destroyed when function returns Storage: Usually on the stack #i...
6. Bonus: Some C Library Functions
Throughout this module, we've focused on defining our own functions. However, C also provides a rich set of built-in functions, known as Standard Library Functions. These functions are pre-written and grouped into various libraries (e.g., <stdio.h>, <stdlib.h>...
7. Recursion
7.1 Understanding Recursion Recursion is a programming technique where a function calls itself. Every recursive function needs: Base case: Condition that stops the recursion Recursive case: Function calls itself with modified parameters 7.2 Python vs C Recur...
8. Function Examples and Applications
8.1 Menu-Driven Program #include <stdio.h> // Function prototypes void display_menu(void); int get_choice(void); void calculator_add(void); void calculator_multiply(void); void display_table(int num); int main() { int choice; do { displa...
9. Common Errors and Debugging
9.1 Function Declaration Errors Error 1: Missing Function Prototype // ERROR: Function used before declaration int main() { int result = add_numbers(5, 3); // Error: 'add_numbers' not declared return 0; } int add_numbers(int a, int b) { return a ...
1. Introduction
Module 6: Tree Author: YP Learning Objectives After completing this module, students are expected to be able to: Explain the basic concept of a Tree as a non-linear data structure. Identify the differences between root, parent, child, leaf, and subtree. Impl...
2. Tree Concept
2.1 Basic Theory 2.1.1 Definition of a Tree A Tree is a non-linear hierarchical data structure composed of nodes and edges. Every Tree has a root (root node). The root can have children. A node with no children is called a leaf. Each node and its descendants...
1. Introduction
Module 9: Advanced Graph Author: YP Learning Objectives After completing this module, students are expected to be able to: Explain the basic concepts of Graph (including adjacency list and adjacency matrix representation). Implement graph traversal using DFS ...
2. Graph Concept
2.1 Theory 2.1.1 Definition of Graph A Graph is a data structure consisting of: Vertex (node) → represents an object. Edge → represents the relationship between objects. Graphs can be: Directed or Undirected. Weighted or Unweighted. 2.1.2 Graph Representa...
Understanding Behavioral Style
One of the three architecture models is the behavioral style. Unlike the data-flow style, a VHDL program written in behavioral style does not need to describe how the circuit will be implemented when synthesized. Instead, the behavioral style describes how the...