[Announcement] Display.printf added

Pokitto::Display::printf() added

1

By request from our STEM school collaborators, a small(*) implementation of printf has been added to Pokitto::Display class(**)

Printf differs from print, because it can print formatted strings (strings including numbers).

For example, the following will print 2 lines of text containing random numbers 0-99. The position and format of the number (decimal, hexadecimal etc) depends on where '%d" is placed inside the string. The newline character \n can be used anywhere in the text to jump to a new line, printf does not do it automatically!

mygame.display.printf("This is a \nrandom \nnumber:%d\n\n",random(100));
mygame.display.printf("And %d is \nanother!",random(100));

* floating point numbers not yet included

** remember to update your PokittoLib library to get this working

(PlatformIO library has also been updated, but may take 1 day from this announcement to show up because of the PlatformIO library update system)

5 Likes