Hi looking for some help with this code. I want to have a letter change in my sprintf code.

char C = 'S';
unsigned long G = 0;
void FileWrite() {
  G = (cycles/10);
  if (cycles > 8001) {
    C = 'F';
    G = ((cycles - 8000)/10); 
  if (cycles > 16001) {
    C = 'H';
    G = ((cycles - 16000)/10);
  char fileName[16];
  sprintf(fileName, "/%d/%s%04d.txt", RecDir, C, G);
  myFile1 = SD.open(fileName, FILE_WRITE);

Right now I am not getting any the letter S to shown in the file name, I would like to have it change letters as my cycles get higher.


try use %c == char

sprintf(fileName, "/%d/%c%04d.txt", RecDir, C, G);

Thank You!