hey so is there a way to returm a number value from a user defined function just like analogRead() or digitalRead() does?
int button = 4;
if(digitalRead(button)){
//do whaever
}
in this code when digitalRead() is called it sends back a true or false within the for loop
how could i do this same thing with a user defined function
int number = 0;
void read_number() {
if(number >= 10){
//send back a true
}
else {
//send back a false
}
if(read_number){
// have it execute the if statement to what the function sends back
}
ive had a lot of programs that this would help with and i'd be awesome if someone knew how o do this. Maybe is just really easy and i just cant figure it out
thanks
int number = 0;
int read_number() {
if(number >= 10){
//send back a true
}
else {
//send back a false
}
if(read_number){
// have it execute the if statement to what the function sends back
}