Ok, I think I came up with the solution
void ls(boolean activate){ // list contents of working directory
static boolean active = false;
static File contents = workingDir.openNextFile();
static byte index = 0;
if(activate){ // given a 'true' is passed to ls it gets called every loop
active = !active;
if(!active){
index = 0;
contents.close();
contents.rewindDirectory();
}
}
if(active){ // when active 'ls' gets called every loop
if(extHapticMessage(MONITOR_MODE)){ // wait till letter is complete
if(contents){ // given a file
char* name = contents.name(); // intilize pointer to array
if(name[index]){ // test for a char
extHapticMessage(name[index]); // vibrates an series of pagers
keyOut(name[index]); // prints letter w/ keyboard emulation
index++; // iterate index for when pagers finish
} else { // when filename is printed
index = 0; // reset index
if(contents.isDirectory()){keyOut('/');} // trail a slash given dir
keyOut(CARIAGE_RETURN); // prepare to print next filename
contents.close(); // gracefully close the file
contents = workingDir.openNextFile(); // open next file
}
}
}
}
}
tl;dr -> char* name = myFile.name()
Creates a pointer (physical address to the first byte of the array) that can be accessed like an array
Seems to work as expected, now to debug the more heuristic issues with my code. Thanks