i have A folder "AUDIO" on sd root. 10 folders in "AUDIO" folder naming
so on
in begining try i wrote code to store paths into array to be use in SD.h library
i hope result may be
but failed i seemed i used wrong code....got error
how to assign to
"B_0","B_1","B_2","B_3"....."B_9" each folder contain 16 .wav files. wav files name start with number like
Code:
-root-----
|----B_0
| |-01FlBeat.wav
| |-02DrRoll.wav
| |-03DrRoll.wav
| |-04HiHat.wav
| |-.......
| |-16EndHit.wav
|
|----B_1
| |-01xxxxxx.wav
| |-02xxxxxx.wav
| |-03xxxxxx.wav
| |-04xxxxxx.wav
| |-.......
| |-16xxxxxx.wav
|
|----B_2
| |-01xxxxxx.wav
| |-02xxxxxx.wav
| |-03xxxxxx.wav
| |-04xxxxxx.wav
| |-.......
| |-16xxxxxx.wav
| |----B_3
| |-01xxxxxx.wav
| |-02xxxxxx.wav
| |-03xxxxxx.wav
| |-04xxxxxx.wav
| |-.......
| |-16xxxxxx.wav
|
in begining try i wrote code to store paths into array to be use in SD.h library
C++:
String B_path[10];
String Str_A = "\AUDIO\B_";
String Str_B = "\";
void setup() {
Serial.begin(9600);
for (int i=0; i<10; i++) {
B_path[i]= Str_A + String(i) + Str_B;
Serial.println(B_path[i]);
}
}
void loop() {
}
\AUDIO\B_0\\AUDIO\B_1\\AUDIO\B_2\\AUDIO\B_3\\AUDIO\B_4\\AUDIO\B_5\\AUDIO\B_6\\AUDIO\B_7\\AUDIO\B_8\\AUDIO\B_9\but failed i seemed i used wrong code....got error
C++:
C:\Users\acer\Documents\Arduino\Ishaan_Toys\Ishaan_Toys.ino:6:17: warning: missing terminating ' character
6 | String Str_B = '\';
| ^
Ishaan_Toys:6: error: missing terminating ' character
6 | String Str_B = '\';
| ^~~~
C:\Users\acer\Documents\Arduino\Ishaan_Toys\Ishaan_Toys.ino:5:17: warning: unknown escape sequence: '\A'
5 | String Str_A = "\AUDIO\B_";
| ^~~~~~~~~~~
C:\Users\acer\Documents\Arduino\Ishaan_Toys\Ishaan_Toys.ino:5:17: warning: unknown escape sequence: '\B'
Ishaan_Toys:7: error: expected primary-expression before 'void'
7 | void setup(void) {
| ^~~~
Ishaan_Toys:15: error: expected ',' or ';' before 'void'
15 | void loop() {
| ^~~~
missing terminating ' character
B_path[i] correctly . to used to open specific folder in SD library ???