Skip to content

Releases: MLXXXp/Arduboy2

Arduboy2 V6.0.0

29 Sep 19:54
Compare
Choose a tag to compare

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.

Arduboy2 V5.3.0

26 Jul 00:55
Compare
Choose a tag to compare

This is mainly just a general cleanup release.

A few functions have been added. Some existing functions have been improved but remain backwards compatible. Some code not considered part of the API has been isolated from public access. Many corrections, updates and additions were made to the documentation.

Unless they used certain undocumented parts of the library, existing sketches should compile properly using this release, with little or no changes in program size.

Changes of note:

  • Added new functions anyPressed(), setCursorX(), setCursorY(). Suggested by @Pharap

  • Added new function SPItransferAndRead(). Suggested by @MrBlinky

  • Made width() and height() functions constexpr. Thanks @Pharap

  • Made Rect and Point class constructors constexpr. Thanks @Pharap

  • Made writeUnitName() const-correct. Thanks @Pharap

  • Moved function generateRandomSeed() from Arduboy2Base to Arduboy2Core. Suggested by @yyyc514 (Josh Goebel)

  • Changed the font and boot logo arrays from being standalone to being public class members. With help and guidance from @Pharap

  • Changed the lcdBootProgram[] array from being standalone to being a protected member of Arduboy2Core.

  • Changed the values used to map system EEPROM from #define macros to protected constexpr members of Arduboy2Base.

  • Refactored the code provided for removing the USB stack. Suggested and developed by @Pharap

  • Fixed functions drawBitmap(), drawSlowXYBitmap() and drawCompressed(), which would sometimes wastefully execute code to draw when the bitmap was entirely off screen by just one pixel. Issue reported by @MrBlinky

  • Fixed portability issues in the Sprites classes. (This doesn't change compiles for the Arduboy in any way.) Issues discovered and fixes developed by @Pharap

  • Fixed a minor visual glitch in the ArduBreakout example sketch. Submitted by @uXeBoy (Dan O'Shea)

  • Changed the ArduBreakout example sketch to use precomputed values for Beep function parameters, to reduce program size. Also did additional cleanup.

  • Added the Team A.R.G. Cabi program code into the extras directory. This is used to convert PNG files to bitmap arrays for the drawCompressed() function. With the demise of Team A.R.G. this program is no longer publicly available from them. The program has been cleaned up somewhat and more detailed documentation has been provided.

  • Applied the CC0 public domain dedication to the BeepDemo and RGBled example sketches.

  • Updated or removed outdated URLs in the documentation.

  • Added file VERSIONING.txt to document the files containing the release version number, which need to be updated for a new release.

  • Updated file Doxyfile to that of Doxygen version 1.8.18

Additional changes are noted in the commits.

Thanks to all those who contributed to this release.

Arduboy2 V5.2.1

27 Feb 23:26
Compare
Choose a tag to compare

Changed the loopto label in fillScreen() to a local label, to prevent a "symbol already defined" error under some circumstances. Thanks @blakewford

Exposed all Print::write() overloads in the inherited Print class. Thanks @Pharap

Added a CONTRIBUTING.md file, to specify how commit messages should be formatted.

Arduboy2 V5.2.0

27 Nov 14:00
Compare
Choose a tag to compare
  • Added function generateRandomSeed(), which will return a random value suitable for seeding random number generators. (This new function is now used by the initRandomSeed() function.) Thanks @Pharap

  • Function drawPixel() has been rewritten to address an issue with the compiler introduced in Arduino V1.8.6. It has also been made static. Plus, it saves a few bytes of program memory. Thanks @MrBlinky

  • Constructors were added to the Point and Rect objects used for collision detection features. The collide() functions were made static. Thanks @Pharap

  • Minor cleanup of #include statements. Thanks @Pharap

Arduboy2 v5.1.0

07 Apr 19:37
Compare
Choose a tag to compare

Added a flag in system EEPROM to control whether the RGB LED is flashed during the boot logo sequence or left off.

Added library functions writeShowBootLogoLEDsFlag() and readShowBootLogoLEDsFlag() for writing and reading the new flag.

Example sketch SetSystemEEPROM modified to allow setting the new flag.

Added code to mainNoUSB() to make sure the TX and RX LEDs are turned off.

Arduboy2 v5.0.0

22 Mar 12:33
Compare
Choose a tag to compare

New features:

  • Classes BeepPin1 and BeepPin2 added. These can be used to play simple tones on the speaker. They are very code efficient.
  • New example sketch BeepDemo demonstrates the use of the BeepPin classes.
  • Class SpritesB added as an alternative to Sprites. This class has the same functions as Sprites but will produce less code in many cases (at the expense of slower execution speed). Thanks, @dxxb (Delio Brignoli)
  • The ability to eliminate the USB code that is normally included in the Arduino environment. This will free up a significant amount of code space but will require the user to do a manual reset in order to upload a new sketch. Thanks, @yyyc514 (Josh Goebel) for the concept.
  • The ability to set a flag in system EEPROM that will bypass the boot logo sequence and go straight to the sketch. New functions writeShowBootLogoFlag() and readShowBootLogoFlag() allow setting and reading this the flag.
  • Example sketch SetNameAndID has been renamed to SetSystemEEPROM. The ability to set the "show boot logo" flag has been added to it. It can now also be used to erase the entire system EEPROM or user EEPROM areas.
  • A new 2 parameter version of setRGBled() allows setting an individual RGB LED, given the color and brightness.
  • New function freeRGBled(). Using setRGBled() will take over the RGB LED pins so that digitalWriteRGB() will no longer work. Calling freeRGBled() will restore the pins for use by digitalWriteRGB().
  • New example sketch RGBled demonstrates the use of the RGB LED in both digital and analog modes.
  • New function setFrameDuration() can set the frame rate as the time per frame (in milliseconds), as an alternative to using setFrameRate() to set the frame rate in frames per second.
  • The loop at the end of the begin() function that waits for all buttons to be released has been replaced by function waitNoButtons(). This is to make it easier to add the functionality back in if boot() is used instead of begin().

Fixed a problem in the Sprites drawPlusMask() function that sometimes caused bitmaps to be drawn improperly. Thanks, @yyyc514 (Josh Goebel)

The speed that the boot logo scrolls down has been increased, so that the actual sketch code begins faster.

The ArduBreakout example sketch has been modified to use the BeepPin1 class instead of Arduino tone().

Functions that have been refactored to optimize for size and usually speed:

  • paintScreen(), which is used by display(), has been re-written in assembler. Thanks, @MrBlinky and @veritazz (Michael Gollnick)
  • setRGBled() directly controls the hardware, instead of using the Arduino analogWrite() function.
  • bootLogoShell() and bootLogoText()
  • drawCompressed(). Thanks, @Pharap and @MrBlinky
  • buttonsState(). Thanks, @MrBlinky
  • nextFrame()
  • begin() (by using display() instead of blank() to clear the display).
  • idle()

Minor clarifications and corrections to previous README.md and Doxygen documentation, plus:

  • Thanks, @eried (Erwin Ried) for correcting a typo in the everyXFrames() example code.
  • Added info on sketch EEPROM use to README.md
  • Changed characters used for Sprites examples to make them more readable.

Arduboy2 v4.1.0

31 Jul 21:28
Compare
Choose a tag to compare

Added complimentary getText... functions for the setText... functions in the Arduboy2 class.

The functions added are getTextColor(), getTextBackground(), getTextSize() and getTextWrap().

Also fixed a few small errors, and added some "see also" references, in the documentation comments.

Arduboy2 v4.0.2

07 Jul 15:51
Compare
Choose a tag to compare

Fixed the initialisation of the Right D-pad button for the DevKit. The wrong port was being addressed so the pin was left floating instead of being pulled up. (This problem only affected the DevKit, not the production Arduboy.)

Thanks to @JO3RI for reporting the problem and helping with the fix.

Arduboy2 v4.0.1

16 Jun 23:03
Compare
Choose a tag to compare
  • Fixed drawPixel() asm code to indicate changed registers to the compiler. Thanks to @Pharap for determining the problem and assisting with the fix.

  • Refactored fillScreen()

Arduboy2 v4.0.0

26 Apr 14:50
Compare
Choose a tag to compare

The main purpose of this release is to reduce code produced by the library, leaving more code space for the sketch itself. The overall size of a sketch will be reduced by around 600 to 1100 bytes, with around 1000 bytes being typical. The actual operation of the sketch will not be affected. This size reduction was mainly achieved by directly controlling the I/O pins and on chip peripherals, instead of using pinMode(), digitalWrite() and other Arduino library functions. Also, existing functions were optimized to reduce size.

  • nextFrame(), drawChar(), drawPixel(), readUnitName(), writeUnitName() and Sprites::drawPlusMask() functions have been optimized to reduce size. Thanks to Josh Goebel @yyyc514 for this.
  • The initRandomSeed() function uses a different technique which produces less code.
  • New functions bootLogoCompressed(), bootLogoSpritesSelfMasked() and bootLogoSpritesOverwrite() can be used in place of bootLogo() to reduce code size in cases where their drawing functions are shared with the same functions used by the sketch. Also, a bootLogoText() function was added that renders the logo as text instead of a bitmap, which can reduce code size at the expense of showing a logo that doesn't look as good.
  • delayShort() function added for delays up to 65535 milliseconds. Using it in place of the Arduino delay() function will save a few bytes.

Other additions and changes:

  • drawPixel() function optimized for speed. Thanks to Josh Goebel @yyyc514 for this.
  • In addition to the current version of digitalWriteRGB(), which takes 3 parameters to control all 3 of the LEDs simultaneously, a new 2 parameter version has been added to allow controlling each individual LED by specifying the LED color and whether to turn it on or off.
  • The displaying of the unit name at the end of the boot logo sequence has been made optional, controlled by a flag set in the system EEPROM area. Functions writeShowUnitNameFlag() and readShowUnitNameFlag() have been added to read and write this flag. The SetNameAndID example sketch has been modified to allow setting the flag.
  • The flashlight() function has been improved to do a better job of allowing a new sketch to be uploaded when the current sketch causes bootloader "magic key" issues. It no longer allows the Down button to be used to continue the sketch, so the unit must now be rebooted after use. Also, function safeMode() has been made available as a lower memory replacement for flashlight().
  • New function SPItransfer() added to be used instead of the SPI library SPI.transfer() function.
  • displayOff() and displayOn() functions added to allow putting the display in a blanked low power state.