Skip to content

Arduboy2 V6.0.0

Latest
Compare
Choose a tag to compare
@MLXXXp MLXXXp released this 29 Sep 19:54
· 12 commits to master since this release

Many thanks go to @Pharap for suggestions and guidance with much of what has been done for this release.

Changes for this release:

  • All functions and variables that could be made static have been. The main purpose for doing this is that it reduces program size and RAM usage. Program savings can be anywhere from a just few bytes to a few thousand but it appears to typically be around 400 bytes for a sketch that uses the Arduboy2 class. Program savings aren't as great for sketches using the Arduboy2Base class. RAM savings are generally around 15 bytes.

  • Added functions getCharacterWidth() getCharacterHeight() getCharacterSpacing() and getLineSpacing() to programmatically get the dimensions of characters rendered using the library text functions, given the desired text size. Sketches using these functions, rather than hard coding values in the sketch itself, may be clearer and more portable.

  • Added functions setTextRawMode() and getTextRawMode(). Text raw mode allows specially handled characters to be printed rather than them performing their usual action. Value \n (0x0a) will be drawn as an "inverse white circle" instead of performing a newline. Value \r (0x0d) will be drawn as a "musical eighth note" instead of it being ignored.

  • Functions write() and drawChar() were refactored for smaller code size, to handle raw mode, and changed slightly in the way they operate:

    • Checking if line wrap is necessary is done before drawing a character, instead of doing it after drawing to prepare for the next character. This fixed a problem with requested line feeds interacting with wrapping, resulting in unexpected blank lines.
    • Spacing added at the end of each character is no longer factored in when determining if a character will fit on screen at the end of a line.
    • Fixed a bug that caused the drawing of characters with a transparent background to not work properly. (This is selected by setting the background color to be the same as the text color.)
  • Made variables currentButtonState and previousButtonState public. This allows them to be used for special circumstances without needing to create a child class or alternative functions. An example of one possible use is given in the documentation for previousButtonState.

  • Added the array lengths to the comments for the boot logo bitmap arrays. Submitted by @ace-dent (forum user @acedent).

  • Added keywords for public variables to file keywords.txt

  • Added a check for the image height to the Cabi bitmap converter utility. It now exits with an error if the height isn't the required multiple of 8 pixels. Also added this requirement to the documentation. Thanks to @unwiredben for suggesting this.

  • Added a new example sketch, FontDemo. This displays the entire library font and allows it to be moved around to demonstrate how text wrapping and raw mode works.

  • Fixed a bug in the BeepDemo example sketch where text on the screen was not positioned properly.

  • Refactored the SetSystemEEPROM utility sketch to use more C++ features and use the new library functions for character sizes.

  • Some additional enhancements and clarifications were made to the documentation.

  • A few other minor changes aren't documented here, since they don't affect anything regarding the API. See the repository commit messages for these.

Note that this release has the major version number changed, indicating some aspect of the API is not backwards compatible. This is only because there's a chance that a sketch that enables text wrapping might behave differently, due to the changes in the way wrapping is now handled.