So, I was trying to make some simple code that would start A at ten, start B at one, and every loop, increase B by one, and add that to A, and the result goes in C, so it would be like this:
11, 13, 16, 21, 26, etc
But the code only adds 1 to A and prints it.
Code:
int a = 10;
int b = 1;
int c = 0;
const int delaySpeed = 1000; // Speed of output. Default one second
void increaseAmount() {
b = b + 1;
c = a + b;
}
void setup() {
Serial.begin(9600);
Serial.println("Ready");
}
void loop() {
delay(delaySpeed);
increaseAmount();
Serial.println(c);
}