The program calls the drawFrame() function multiple times but the function is not in the code you posted.
It also does
drawBatteryCapacity;
which is meaningless. If it meant to call a function then it doesn't but even if it did the function does not exist in the program.
Where did you get the code ?