Arduino Chaîne De Problème De Mise En Forme

Je suis en train de faire un Arduino alimenté à l'horloge, et dans le processus, je suis en train de format des nombres entiers à deux chiffres formaté cordes pour le temps de lire (par exemple: 1 "01").

La suite me donne "erreur: primary-expression before '{' token":

char * formatTimeDigits (int num) {
  char strOut[3] = "00";
  if (num < 10) {
    strOut = {'0', char(num)};
  }
  else {
    strOut = char(num);
  }
  return strOut;
}

Je suis en train de l'utiliser comme suit:

void serialOutput12() {
  printWeekday(weekday); //picks the right word to print for the weekday
  Serial.print(", "); //a comma after the weekday
  Serial.print(hour12, DEC); //the hour, sent to the screen in decimal format
  Serial.print(":"); //a colon between the hour and the minute
  Serial.print(formatTimeDigits(minute)); //the minute
  Serial.print(":"); //a colon between the minute and the second
  Serial.print(formatTimeDigits(second)); //the second
}

Aucune idée de ce que je suis en manque ici?

OriginalL'auteur amb9800 | 2009-11-24