This tutorial #BB9 shows you how to make your code more readable. Therefore, the program is easier to debug. It involves creating a library for each sensor you use and your globals.
In #BB10, he explains the "::" in the code refers to a namespace which is a helpful way of knowing where the function is from. It ensures that sensors or such with the same function name don't interfere with each other and also helps with debugging.
This method of styling through an array is
You don't have to worry about getting the number of elements in there. The compiler does the work for you. It is a read-only using nothing in front of the variable before the colon. If you add "&" before the variable, it is by reference, meaning you can change the value.
The ESP32 has printf() built-in. You don't need to install any libraries. Printf allows you to not use many Serial.print() statements.
Queues are typically used when passing data or messages between tasks. They provide a buffered storage mechanism where tasks can enqueue and dequeue elements in a FIFO order. A queue may be a suitable choice If your application involves passing data between tasks.
Semaphores, on the other hand, are used for signaling and synchronization purposes. They are often employed to control access to shared resources or coordinate the execution of multiple tasks. Semaphores can be binary (allowing only one task to access a resource at a time) or counting (allowing multiple tasks to access a resource up to a certain limit). A semaphore may be a better fit if your application requires coordination or mutual exclusion.
The ESP32 Arduino logger capability allows you to record and store valuable information or messages during the execution of your program on the ESP32 microcontroller using the Arduino programming environment. It helps you keep track of events, debug your code, and monitor the behavior of your project.
With the ESP32 Arduino logger, you can:
Log Messages: You can use the logger to write messages to a designated storage location, such as a file or a serial monitor. These messages can include information about the program's progress, important events, sensor readings, or error messages.
Debugging: When something doesn't work as expected, you can insert log messages at strategic points in your code to help you understand what is happening. By examining the logged messages, you can identify the cause of issues and track the flow of your program.
Monitoring: The logger enables you to monitor the behavior of your project in real-time. You can log data from sensors, variables, or specific states, allowing you to analyze and understand how your project is functioning.
Timestamps: The logger can include timestamps in the logged messages, providing a chronological reference to the events or actions occurring during program execution. This helps you establish a timeline and track the sequence of events.
debuglnE("This is an error debugging statement for when things fail");
debugW("A warning message that doesn't include a new line");
debuglnD("A general debugging level statement");
debuglnV("A verbose message, usually reserved for nitty, gritty debugging);
Stop using Serial.print()