The appended piece of code produces garbage values periodically. Can someone help me fix this?
void updateStatusSentence() { char statusArray[17] = ""; int currentStatus = 7; statusArray[0] = 'A'; statusArray[1] = (currentStatus/1)%10 + 48; int bladeSpeed = 1; statusArray[5] = ((bladeSpeed/10)%10) + 48; statusArray[6] = ((bladeSpeed/1)%10)+ 48; int temperature = 359; statusArray[2] = ((temperature/100)%10)+ 48; statusArray[3] = ((temperature/10)%10)+ 48; statusArray[4] = ((temperature/1)%10)+ 48; int weight = 0; statusArray[11] = ((weight/1000)%10)+ 48; statusArray[12] = ((weight/100)%10)+ 48; statusArray[13] = ((weight/10)%10)+ 48; statusArray[14] = ((weight/1)%10)+ 48; int currentTime = 1114; statusArray[7] = ((currentTime/1000)%10+ 48); statusArray[8] = ((currentTime/100)%10)+ 48; statusArray[9] = ((currentTime/10)%10)+ 48; statusArray[10] = ((currentTime/1)%10)+ 48; statusArray[15] = 'B'; statusArray[16] = '\0'; for (int i = 0; i < 17; i++) { Serial.print(statusArray[i]); } }