What’s wrong with this code? I’m trying to print real-time motor velocity and temperature to the brain and velocity to the controller screen but it’s spitting out random numbers that change randomly after “RPM:” and after “Temp:”.
Here is my code:
is the format character for
It worked. Thank you so much. Is there a function that can truncate the numbers tho.
Multiply by some power of 10, round it off, then divide by the same power of 10. Print that result. Usually works. Most print format strings don’t have rounding specifiers built in.
you can limit the number of decimal places shown like this
What do those crazy number number and letter combinations even mean you ask! Well wonder no more:
December 19, 2018, 9:15am
This is kinda off-topic but…
@goofnrox why in the world is there an uppercase decimal point, especially when the lowercase one looks exactly the same?
Because floating point numbers include items like “INF” for infinity and “NAN” for not-a-number, which can be printed in upper or lower case.
Brain.Screen.Print does not support the complete list of formats shown, only the most common ones. however, using the standard library sprintf to create a string should.