i have an big program on my arduino UNO, but the program its a series of checks and can be taken into very small parts.
To be easier to avoid errors and my my program easier to understand i'm thinking in making the "void loop()" a small "program" that only calls other loops.
void loop() {
check_temperature_sensors();
turn_lights_on();
check_humidity_sensors();
upload_values_to_mysql();
} //end of loop
void check_temperature_sensors() {
//here the code that will check the temperatures and save it to 3 diferent global variables,
so i don't need to return any value because it writes to the global variables that
are accessible to the entire program
}
No, you have a "function" for each part; I already explained that.
The way your functions must communicate their results is via global variables; there's no other way.
This is not always ideal, and can result in inflexibility.