int summation = 0;
void setup() {
Serial.begin(9600);
// put your setup code here, to run once:
}
void loop() {
summation = localAddition(5, 3);
Serial.println(summation);
delay(1000);
globalAddition(1, 2);
Serial.println(summation);
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}
int localAddition(int a, int b){
int sum = a + b;
return sum;
}
void globalAddition(int a, int b){
summation = a + b;
}