Extra high level things for Arduboy development
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
examples/walkingwizard
ArduboyExtra.cpp
ArduboyExtra.h
MIT-LICENSE
README.md
physics.cpp
physics.h
simple_buttons.cpp
simple_buttons.h
sprites.cpp
sprites.h

README.md

ArduboyExtra

Usage

#include <ArduboyExtra.h>
// include the extra modules you intent to use
#include "simple_buttons.h"

// create your arduboy object from the core lib
Arduboy arduboy;
// create a variable to hold buttons API
SimpleButtons buttons (arduboy);

// define our own nextFrame so we can inject other libraries that may
// need to poll or do things per frame
boolean nextFrame()
{
    if (arduboy.nextFrame()) {
        buttons.poll();
        return true;
    }
    return false;
}

// example of using it in your actual sketch
void loop()
{
    if (!nextFrame())
        return;
        
    if (buttons.pressed(LEFT_BUTTON)) {
        // do cool stuff
    }
}