Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: helloworld.hpp
- Revision:
- 2:e3ef9f476913
- Parent:
- 1:c53e766082b4
--- a/helloworld.hpp Fri Jan 06 22:10:20 2017 +0000
+++ b/helloworld.hpp Fri Jan 06 22:29:05 2017 +0000
@@ -16,16 +16,14 @@
// make an instance of arduboy used for many functions
DigitalOut led2(LED2);
-DigitalOut led3(LED3);
MbedBoy arduboy;
// This function runs once in your game.
// use it for anything that needs to be set only once in your game.
void setup() {
- printf("start setup");
- led2 = 0;
- led3 = 0;
+ led2 = 1;
+
// initiate arduboy instance
arduboy.start();
@@ -34,40 +32,28 @@
// here we set the framerate to 15, we do not need to run at
// default 60 and it saves us battery life
// arduboy.setFrameRate(15);
- printf("end setup");
}
// our main game loop, this runs once every cycle/frame.
// this is where our game logic goes.
void loop() {
- printf("start loop");
// pause render until it's time for the next frame
- // if (!(arduboy.nextFrame()))
- // return;
+ if (!(arduboy.nextFrame()))
+ return;
-// wait_ms(2000);
-// led2 = 1;
+ led2 = 0;
// first we clear our screen to black
// arduboy.clear();
// wait_ms(2000);
- // led2 = 0;
// we set our cursor 5 pixels to the right and 10 down from the top
// (positions start at 0, 0)
arduboy.setTextCursor(1, 1);
- arduboy.writeChar('h');
- arduboy.writeChar('e');
- arduboy.writeChar('l');
- arduboy.writeChar('l');
- arduboy.writeChar('o');
// then we print to screen what is in the Quotation marks ""
- //arduboy.printf("Hello, world!");
+ arduboy.printf("Hello, world!");
// wait_ms(2000);
- led2 = 1;
arduboy.drawCircle(30,30,30,WHITE);
// then we finaly we tell the arduboy to display what we just wrote to the display
arduboy.display();
- led3 = 1;
- printf("end loop");
}