Missing 8 And 9 Character

I’ve encountered a peculiar problem when printing things on the Brain. I’ve tried to print the number 8 and 9 on the screen, but 10 and 11 are printed. It seems that the brain skips 8 and 9 since the sequence continues as usual.

void pre_auton( void ) {
  // All activities that occur before the competition starts
  // Example: clearing encoders, setting servo positions, ...
  Brain.Screen.clearScreen();
  Brain.Screen.printAt(30, 30, "%o", 1);
  Brain.Screen.printAt(30, 50, "%o", 2);
  Brain.Screen.printAt(30, 70, "%o", 3);
  Brain.Screen.printAt(30, 90, "%o", 4);
  Brain.Screen.printAt(30, 110, "%o", 5);
  Brain.Screen.printAt(30, 130, "%o", 6);
  Brain.Screen.printAt(30, 150, "%o", 7);
  Brain.Screen.printAt(30, 170, "%o", 8);
  Brain.Screen.printAt(30, 190, "%o", 9);
  Brain.Screen.printAt(30, 210, "%o", 10);
}

This is the result from the code above:

20191003_163031

Er, that’s because you are asking to print in octal. Use %d as format string.

5 Likes

Oh, okay! Thank you for helping. I don’t like C++ and my brain kinda died!