From c5445c7b9cd4a9d73f3e196fd612909ee687cac7 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 28 Feb 2016 02:14:53 -0500 Subject: [PATCH] fix examples with now breaking API changes --- examples/Buttons/Buttons.ino | 9 +++++---- examples/HelloWorld/HelloWorld.ino | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/Buttons/Buttons.ino b/examples/Buttons/Buttons.ino index b1e24dc..b5514c3 100644 --- a/examples/Buttons/Buttons.ino +++ b/examples/Buttons/Buttons.ino @@ -16,9 +16,10 @@ version 2.1 of the License, or (at your option) any later version. // Make an instance of arduboy used for many functions Arduboy arduboy; +AbPrinter text(arduboy); // Variables for your game go here. -char text[] = "Press Buttons!"; +char title[] = "Press Buttons!"; byte x; byte y; @@ -52,7 +53,7 @@ void setup() { // here we set the framerate to 30, we do not need to run at default 60 and // it saves us battery life. arduboy.setFrameRate(30); - + // set x and y to the middle of the screen x = (WIDTH / 2) - (NUM_CHARS * CHAR_WIDTH / 2); y = (HEIGHT / 2) - (CHAR_HEIGHT / 2); @@ -96,10 +97,10 @@ void loop() { arduboy.clear(); // we set our cursor x pixels to the right and y down from the top - arduboy.setCursor(x, y); + text.setCursor(x, y); // then we print to screen what is stored in our text variable we declared earlier - arduboy.print(text); + text.print(title); // then we finaly we tell the arduboy to display what we just wrote to the display. arduboy.display(); diff --git a/examples/HelloWorld/HelloWorld.ino b/examples/HelloWorld/HelloWorld.ino index b5d26a0..34db60f 100644 --- a/examples/HelloWorld/HelloWorld.ino +++ b/examples/HelloWorld/HelloWorld.ino @@ -15,6 +15,7 @@ version 2.1 of the License, or (at your option) any later version. // make an instance of arduboy used for many functions Arduboy arduboy; +AbPrinter text(arduboy); // This function runs once in your game. @@ -40,11 +41,11 @@ void loop() { arduboy.clear(); // we set our cursor 5 pixels to the right and 10 down from the top - // (positions start at 0, 0) - arduboy.setCursor(4, 9); + // (positions start at 0, 0) + text.setCursor(4, 9); // then we print to screen what is in the Quotation marks "" - arduboy.print(F("Hello, world!")); + text.print(F("Hello, world!")); // then we finaly we tell the arduboy to display what we just wrote to the display arduboy.display();