Arduboy2 Library
6.0.0
|
The Arduboy2Core class for Arduboy hardware initilization and control. More...
#include <Arduino.h>
#include <avr/power.h>
#include <avr/sleep.h>
Go to the source code of this file.
Classes | |
class | Arduboy2Core |
Lower level functions generally dealing directly with the hardware. More... | |
Macros | |
#define | RGB_ON LOW |
#define | RGB_OFF HIGH |
#define | RED_LED 10 |
#define | GREEN_LED 11 |
#define | BLUE_LED 9 |
#define | LEFT_BUTTON _BV(5) |
#define | RIGHT_BUTTON _BV(6) |
#define | UP_BUTTON _BV(7) |
#define | DOWN_BUTTON _BV(4) |
#define | A_BUTTON _BV(3) |
#define | B_BUTTON _BV(2) |
#define | PIN_SPEAKER_1 5 |
#define | PIN_SPEAKER_2 13 |
#define | WIDTH 128 |
#define | HEIGHT 64 |
#define | ARDUBOY_NO_USB |
Eliminate the USB stack to free up code space. More... | |
The Arduboy2Core class for Arduboy hardware initilization and control.
Definition in file Arduboy2Core.h.
#define A_BUTTON _BV(3) |
The A button value for functions requiring a bitmask
Definition at line 72 of file Arduboy2Core.h.
#define ARDUBOY_NO_USB |
Eliminate the USB stack to free up code space.
This macro will cause the USB code, normally included in the sketch as part of the standard Arduino environment, to be eliminated. This will free up a fair amount of program space, and some RAM space as well, at the expense of disabling all USB functionality within the sketch (except as power input).
The macro should be placed before the setup()
function definition:
As stated in the warning above, without the USB code an uploader program will be unable to automatically force a reset into the bootloader to upload a new sketch. The user will have to manually invoke a reset. In addition to eliminating the USB code, this macro will check if the DOWN button is held when the sketch first starts and, if so, will call exitToBootloader()
to start the bootloader for uploading. This makes it easier for the user than having to press the reset button.
However, to make it even more convenient for a user to invoke the bootloader it is highly recommended that a sketch using this macro include a menu or prompt that allows the user to press the DOWN button within the sketch, which should cause exitToBootloader()
to be called.
At a minimum, the documentation for the sketch should clearly state that a manual reset will be required, and give detailed instructions on what the user must do to upload a new sketch.
Definition at line 305 of file Arduboy2Core.h.
#define B_BUTTON _BV(2) |
The B button value for functions requiring a bitmask
Definition at line 73 of file Arduboy2Core.h.
#define BLUE_LED 9 |
The pin number for the blue color in the RGB LED.
Definition at line 55 of file Arduboy2Core.h.
#define DOWN_BUTTON _BV(4) |
The Down button value for functions requiring a bitmask
Definition at line 71 of file Arduboy2Core.h.
#define GREEN_LED 11 |
The pin number for the greem color in the RGB LED.
Definition at line 54 of file Arduboy2Core.h.
#define HEIGHT 64 |
The height of the display in pixels
Definition at line 244 of file Arduboy2Core.h.
#define LEFT_BUTTON _BV(5) |
The Left button value for functions requiring a bitmask
Definition at line 68 of file Arduboy2Core.h.
#define PIN_SPEAKER_1 5 |
The pin number of the first lead of the speaker
Definition at line 111 of file Arduboy2Core.h.
#define PIN_SPEAKER_2 13 |
The pin number of the second lead of the speaker
Definition at line 112 of file Arduboy2Core.h.
#define RED_LED 10 |
The pin number for the red color in the RGB LED.
Definition at line 53 of file Arduboy2Core.h.
#define RGB_OFF HIGH |
For digitially setting an RGB LED off using digitalWriteRGB()
Definition at line 36 of file Arduboy2Core.h.
#define RGB_ON LOW |
For digitially setting an RGB LED on using digitalWriteRGB()
Definition at line 35 of file Arduboy2Core.h.
#define RIGHT_BUTTON _BV(6) |
The Right button value for functions requiring a bitmask
Definition at line 69 of file Arduboy2Core.h.
#define UP_BUTTON _BV(7) |
The Up button value for functions requiring a bitmask
Definition at line 70 of file Arduboy2Core.h.
#define WIDTH 128 |
The width of the display in pixels
Definition at line 243 of file Arduboy2Core.h.