I started a counter that adds each time the reset() function runs within each letter. I set up a conditional to where if the counter becomes greater than 27, it should run a stop function makes the code idle. I don't know why my code keeps running even after the counter surpasses 27. Any suggestions? Go easy, I'm trying.
void Alphabet(){ //my main function
if (i < 27) {
A();
B();
C();
D();
E();
Eff();
G();
H();
I();
J();
K();
L();
M();
N();
O();
P();
Q();
R();
S();
T();
U();
V();
W();
X();
Y();
Z();
}
else if(i>27){ //my else statment, I tried using a normal else but it wouldn't work
Serial.print("Now I Know My ABCs");
stop();
}
}
void Reset() { // my reset function
botpinky.write(90);
toppinky.write(90);
botring.write(90);
topring.write(90);
botbird.write(90);
topbird.write(90);
botpoint.write(90);
toppoint.write(90);
botthumb.write(90);
topthumb.write(90);
wristrot.write(90);
wristang.write(90);
delay(pause);
i = ++i;
Serial.print(i);
}
void A() { //example of a letter function
botpinky.write(0);
toppinky.write(0);
botring.write(0);
topring.write(0);
botbird.write(0);
topbird.write(0);
botpoint.write(0);
toppoint.write(0);
botthumb.write(90);
topthumb.write(90);
wristrot.write(90);
wristang.write(90);
delay(pause);
Reset();
}