hello i am trying to make a a calculation now i want to print my result. in mine serieel monitor it doesnt show nothing
int myFunction(int x, int y) {
return x + y;
}
int calculation() {
int z = myFunction(5, 3);
Serial.println(z);
return 0;
}
void setup() {
Serial.begin(9600);
}
void loop() {
}
You haven't called your functions
You are not calling the myFunction() and calculation() functions in your sketch so no wonder nothing is printed
The calculation() function calls myFunction() but calculation() is never called
Please post the corrected code so that others can benefit from the solution
int myFunction(int x, int y) {// variable + parameters
return x + y;
}
int calculation() {
int z = myFunction(5, 3);
Serial.println(z);// print z
return 0;
}
void setup() {
Serial.begin(9600);
}
void loop() {
calculation();
}