Commit Graph

215 Commits

Author SHA1 Message Date
Scott Allen ecedeac7af Fix paintScreen() for IDE 1.6.10
paintScreen() used instruction padding for a delay to allow a byte to be sent
to the display using SPI. This delay became to short with the new gcc version
in Arduino IDE 1.6.10

The function has been changed to test for the serial transfer to complete
before sending the next byte.
2016-08-03 20:49:16 -04:00
Scott Allen 2e2f43b425 Add new "includes" property to library.properties 2016-08-03 20:40:05 -04:00
Scott Allen d0c0a940f2 No need for size of sBuffer[] array in definition
The number of elements in the sBuffer[] array is already specified
in the declaration.
2016-08-03 20:16:54 -04:00
Scott Allen d91314cdaf Add files library.json and FILE_DESCRIPTIONS.md 2016-06-30 21:32:20 -04:00
Scott Allen d17075f7be Make screen buffer static & frame vars protected 2016-06-30 19:59:56 -04:00
Scott Allen 3b96b7ba24 Migrate example sketches
Renamed Tunes to PlayTune and enhanced it to better demonstrate the
ArduboyPlaytune library's capabilities.
2016-06-30 19:40:17 -04:00
Scott Allen 6c5b2cd783 Update README.md and library.properties
Also deleted file UPGRADING_12.md
2016-06-30 19:39:37 -04:00
Scott Allen 5285c9d2af Move core and audio files to the src directory
To allow ArduboyCore and ArduboyAudio to be used as public base classes.
Changed the file names to match the names of the classes they contain.
2016-06-27 18:52:10 -04:00
Scott Allen ad5da39fdc Make color parameter in draw functions optional
Color defaults to WHITE.

Also:
- Document frame functions and getPixel().
- Change screen buffer from unsigned char to uint8_t
2016-06-27 17:04:01 -04:00
Scott Allen 44b6a6df98 Remove unnecessary includes 2016-06-27 15:42:02 -04:00
Scott Allen 2c023b30ef Change indenting and rearrange audio.cpp
Only cosmetic changes. No functional changes.
2016-06-26 17:37:58 -04:00
Scott Allen c0f04bcb92 Update keywords.txt 2016-06-15 16:18:06 -04:00
Scott Allen 1f641b1e67 Remove #define DEVKIT
DEVKIT was an alias of AB_DEVKIT.
2016-06-15 15:16:31 -04:00
Scott Allen 53fd241064 Remove start(), clearDisplay(), getInput()
These functions were previously deprecated and renamed to
begin(), clear(), buttonsState()
2016-06-15 14:59:31 -04:00
Scott Allen 0e89bcdf2e Change boolean to bool, byte to uint8_t 2016-06-15 14:15:47 -04:00
Scott Allen f7915cd0a9 Turn on all display pixels in "flashlight" mode
Mainly to give an indication that the device is in "flashlight" mode
for units that have the RGB LED installed reversed.

Also, the test for the UP button is moved to within flashlight() itself.
2016-06-15 13:25:57 -04:00
Scott Allen 3c4ebf59c2 Set RGB LED digitally for boot logo & flashlight
Instead of PWM, basic digital output is used to control the RGB LED in the
bootLogo() and flashlight() functions. This reduces code size for sketches
which don't use the setRGBled() function. In bootLogo(), instead of dimming
the red LED, the red then green then blue LEDs are lit in sequence at full
brightness.

digitalWriteRGB() was added as a public function and is also used for the
changes above.
2016-06-14 16:27:21 -04:00
Scott Allen e2458e6645 Add boot up system control
Checks if the "B" button is being held down when begin() is called.
If so, waits for other buttons to be pressed to control system functions.
Functions implemented:
 "UP" button: Set "sound enabled" in EEPROM.
 "DOWN" button: Set "sound disabled" (mute) in EEPROM.
2016-06-13 14:21:45 -04:00
Scott Allen 107cb2befd Remove arduino-playtune lib from CONTRIBUTERS.md 2016-06-10 20:00:40 -04:00
Scott Allen 84b9fe1708 Rename file LICENSE to LICENSE.txt 2016-06-10 20:00:39 -04:00
Scott Allen 54c1fb79ba Changes to create Arduboy2 library from Arduboy
Based on Arduboy library V1.2 development as of April 2, 2016

- Class Arduboy2 replaces class Arduboy.
- Removed files ab_printer.h and ab_printer.cpp. Integrated their
  functionality into class Arduboy2 (as with Arduboy V1.1).
- Added new text functions:
  - getCursorX(), getCursorY() to get the current cursor position.
  - setTextColor(), setTextBackground() to allow inverted text
    (black on white).
  - clear() is overridden to set the cursor to 0, 0 in addition to clearing
    the screen buffer.
- New Class: Arduboy2Base which contains most of the Arduboy functions and
  is inherited by Arduboy2. It doesn't inherit Print, and doesn't include
  text display and cursor control functions. Using it instead of Arduboy2,
  in sketches that don't use text functions, frees up some code space.
- Function drawChar() is in Arduboy2 instead of Arduboy2Base.
- Made setRGBled() static. Not making it static was an oversight.

("Tunes" functions are still moved to the separate ArduboyPlaytune library,
as they were in Arduboy V1.2)
2016-06-10 20:00:39 -04:00
Scott Allen b71b2815b2 Indent some lines for consistency 2016-05-26 18:30:27 -04:00
Scott Allen ded48cef81 Fix setting CPU clock to 8MHz
A dedicated #define is used.
The PLL prescaler for USB is readjusted.
2016-05-26 18:30:27 -04:00
rogosher f6e7ee40e7 using bool type 2016-05-26 18:30:27 -04:00
rogosher ca2aeb19ec adding bool type 2016-05-26 18:30:27 -04:00
Scott Allen dd6a337242 Fix bug created when AbPrinter class was added 2016-05-26 18:30:27 -04:00
Josh Goebel 2361d0d20f audio on/off sets up pins appropriately for each mode 2016-05-26 18:30:27 -04:00
Scott Allen 305423f600 Use angle brackets for including Arduboy.h 2016-05-26 18:30:27 -04:00
Scott Allen ba367bc2c6 Remove duplicate Arduboy.h include 2016-05-26 18:30:27 -04:00
Scott Allen 44a175eae0 Change EEPROM write() to update() 2016-05-26 18:30:26 -04:00
Scott Allen 2d0a6317a3 Combine function __attribute__ statments
Also delete getInput keyword and add buttonsState keyword
2016-05-26 18:30:26 -04:00
Scott Allen 7f8897cd20 Add keywords for audio functions 2016-05-26 18:30:26 -04:00
Scott Allen daa2128252 Add a #define for the library version 2016-05-26 18:30:26 -04:00
rogosher c11a359269 Update library.properties 2016-05-26 17:19:18 -04:00
Josh Goebel 6911461635 upgrading to 1.2 doc 2016-05-26 17:19:18 -04:00
Josh Goebel 993877b641 fix frame timing
previosly timing was calculating the next frame based on now + duration
when the correct timing should have been last_frame + duration.

This would have the effect of slowing the game down the higher your CPU
usage.  A 0% CPU usage game would  play at the request frame rate,
but a 100% CPU usage game would play at only half the requested frame rate.

(RR is render time below)

Timing with the bug:
60FPs requested, 35FPs actual, 3 frames, 87ms.
|         29ms         |         29ms         |         29ms         |
| RR 12ms + 17ms sleep | RR 12ms + 17ms sleep | RR 12ms + 17ms sleep |

Timing after the fix:
60FPs, 60FPs actual, 3 frames, 51ms.
|       17ms      |       17ms      |       17ms      |
| RR 12ms + sleep | RR 12ms + sleep | RR 12ms + sleep |

After this fix you may need to change your games timing mechanics or
adjust your frame rate (to slow things back down). Your game will run
faster after this fix, even if you were using "100% CPU" before.
2016-05-26 17:19:18 -04:00
Josh Goebel c5445c7b9c fix examples with now breaking API changes 2016-05-26 17:19:18 -04:00
Josh Goebel 8eb4deed69 ardubreakout should use new separate print class 2016-05-26 17:19:18 -04:00
Josh Goebel 2223f5e835 ArduBreakout should use shared libraries for music 2016-05-26 17:19:18 -04:00
Josh Goebel c22e156f60 make sure audio is on 2016-05-26 17:19:18 -04:00
Josh Goebel 81c534ee3d rip out tunes 2016-05-26 17:19:18 -04:00
Josh Goebel 390e5919dc break out printing into separate class (-2,014 bytes)
- stated savings is for any graphics only programs
  not using the printing code at all
2016-05-26 17:19:18 -04:00
Scott Allen 5042811cec Remove logo and clean up ArduBreakout
Scroll down "Arduboy" logo was removed because the library now
provides a similar logo.

setup() and loop() moved to the beginning of the code.

Minor changes and cleanup.
2016-05-26 17:19:18 -04:00
Josh Goebel 6d13d7cb43 faster drawFastHLine from Adafruit SSD1306 lib
- +32 bytes for faster line rendering
2016-05-26 17:19:18 -04:00
Josh Goebel fe1ccc65ac explain why audio pins are not in bootPins 2016-05-26 17:19:18 -04:00
Josh Goebel f41441fe68 rename internal core boot utils for consistency 2016-05-26 17:19:18 -04:00
Josh Goebel c081d281fe reorder defines and use base 10 for clarity 2016-05-26 17:19:18 -04:00
Josh Goebel e346d587ca core.h already includes SPI 2016-05-26 17:19:18 -04:00
Josh Goebel 592d13bd93 individual pixel color is not a Core concept
- core only deals with pixel data in bytes (groups of 8 pixels)
- invert has no meaning at all to Core
2016-05-26 17:19:18 -04:00
Josh Goebel 47114cf366 remove extra ; 2016-05-26 17:19:18 -04:00