diff --git a/README.md b/README.md index 3939f64..65313e0 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,8 @@ A user settable *unit name* of up to 6 characters can be saved in system EEPROM Once the logo display sequence completes, the sketch continues. +For developers who wish to quickly begin testing, or impatient users who want to go strait to playing their game, the boot logo sequence can be bypassed by holding the *RIGHT* button while powering up, and then releasing it. Alternatively, the *RIGHT* button can be pressed while the logo is scrolling down. + ### "Flashlight" mode If the *UP* button is pressed and held when the Arduboy is powered on, it enters *flashlight* mode. This turns the RGB LED fully on, and all the pixels of the screen are lit, resulting in a bright white light suitable as a small flashlight. (For an incorrect RGB LED, only the screen will light). To exit *flashlight* mode, press the *DOWN* button to continue with the sketch. @@ -193,6 +195,11 @@ void Arduboy2Base::begin() audio.begin(); bootLogo(); + + // wait for all buttons to be released + do { + delay(50); + } while (buttonsState()); } ``` diff --git a/src/Arduboy2.cpp b/src/Arduboy2.cpp index fb024a6..9b5c5e5 100644 --- a/src/Arduboy2.cpp +++ b/src/Arduboy2.cpp @@ -45,6 +45,11 @@ void Arduboy2Base::begin() audio.begin(); bootLogo(); + + // wait for all buttons to be released + do { + delay(50); + } while (buttonsState()); } void Arduboy2Base::flashlight() @@ -92,7 +97,12 @@ void Arduboy2Base::bootLogo() { digitalWrite(RED_LED, RGB_ON); - for(int8_t y = -18; y <= 24; y++) { + for (int8_t y = -18; y <= 24; y++) { + if (pressed(RIGHT_BUTTON)) { + digitalWriteRGB(RGB_OFF, RGB_OFF, RGB_OFF); // all LEDs off + return; + } + if (y == -4) { digitalWriteRGB(RGB_OFF, RGB_ON, RGB_OFF); // green LED on } diff --git a/src/Arduboy2.h b/src/Arduboy2.h index 2a6e07b..61740a3 100644 --- a/src/Arduboy2.h +++ b/src/Arduboy2.h @@ -236,6 +236,11 @@ class Arduboy2Base : public Arduboy2Core * The Arduboy logo scrolls down from the top of the screen to the center * while the RGB LEDs light in sequence. * + * If the RIGHT button is pressed while the logo is scrolling down, + * the boot logo sequence will be aborted. This can be useful for + * developers who wish to quickly start testing, or anyone else who is + * impatient and wants to go straight to the actual sketch. + * * This function calls `bootLogoExtra()` after the logo stops scrolling down, * which derived classes can implement to add additional information to the * logo screen. The `Arduboy2` class uses this to display the unit name.