I am only replacing a portion of my code where I want to use the first method but as you can see it is making my sketch size little bigger
//if(iBPM >= 40 || iBPM <= 170 )
{
char iBPMwav[50];
String thisString = String(iBPM);
String stringThree = "n" + thisString;
stringThree = stringThree + ".wav";
stringThree.toCharArray(iBPMwav, 50);
tmrpcm.play(iBPMwav);
}
Sketch uses 29678 bytes (100%)
This is simple but at the end, I want to go from the number 40 up to 170, and this is why I want to use the first method.
//if(iBPM >= 40 || iBPM <= 170 )
{
if(iBPM == 71)
tmrpcm.play("n71.wav");
else if(iBPM == 72)
tmrpcm.play("n72.wav");
else if(iBPM == 73)
tmrpcm.play("n73.wav");
else if(iBPM == 74)
tmrpcm.play("n74.wav");
else if(iBPM == 75)
tmrpcm.play("n75.wav");
else if(iBPM == 76)
tmrpcm.play("n76.wav");
else if(iBPM == 77)
tmrpcm.play("n77.wav");
else if(iBPM == 78)
tmrpcm.play("n78.wav");
else if(iBPM == 79)
tmrpcm.play("n79.wav");
else if(iBPM == 80)
tmrpcm.play("n80.wav");
else if(iBPM == 81)
tmrpcm.play("n81.wav");
else if(iBPM == 82)
tmrpcm.play("n82.wav");
else if(iBPM == 83)
tmrpcm.play("n83.wav");
else if(iBPM == 84)
tmrpcm.play("n84.wav");
else if(iBPM == 85)
tmrpcm.play("n85.wav");
else if(iBPM == 86)
tmrpcm.play("n86.wav");
else if(iBPM == 87)
tmrpcm.play("n87.wav");
else if(iBPM == 89)
tmrpcm.play("n89.wav");
else if(iBPM == 90)
tmrpcm.play("n90.wav");
else if(iBPM == 91)
tmrpcm.play("n91.wav");
else if(iBPM == 92)
tmrpcm.play("n92.wav");
else if(iBPM == 93)
tmrpcm.play("n93.wav");
else if(iBPM == 94)
tmrpcm.play("n94.wav");
else if(iBPM == 95)
tmrpcm.play("n95.wav");
else if(iBPM == 96)
tmrpcm.play("n96.wav");
else if(iBPM == 97)
tmrpcm.play("n97.wav");
else if(iBPM == 98)
tmrpcm.play("n98.wav");
else if(iBPM == 99)
tmrpcm.play("n99.wav");
else if(iBPM == 100)
tmrpcm.play("n100.wav");
else if(iBPM == 101)
tmrpcm.play("n101.wav");
else if(iBPM == 102)
tmrpcm.play("n102.wav");
else
tmrpcm.play("n170.wav");
}
Sketch uses 29024 bytes (101%)
iBPM >= 40 || iBPM <= 170is always true? – Edgar Bonet Jul 04 '19 at 11:02I didn't know– Noajm IsMy Name Jul 05 '19 at 06:08>=,<=and||mean. – Edgar Bonet Jul 05 '19 at 09:24