PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)
Dependents: YATTT sd_map_test cPong SnowDemo ... more
PokittoLib
Library for programming Pokitto hardware
How to Use
- Import this library to online compiler (see button "import" on the right hand side
- DO NOT import mbed-src anymore, a better version is now included inside PokittoLib
- Change My_settings.h according to your project
- Start coding!
Diff: POKITTO_CORE/PokittoCore.cpp
- Revision:
- 2:968589ca3484
- Parent:
- 1:4b1511a0a2c2
- Child:
- 3:689c3cbbef13
--- a/POKITTO_CORE/PokittoCore.cpp Mon Sep 18 12:34:05 2017 +0000 +++ b/POKITTO_CORE/PokittoCore.cpp Tue Sep 19 08:47:36 2017 +0000 @@ -47,7 +47,7 @@ char selectedfile[25]; -#define F +//#define F #ifndef POK_SIM /** start the user application @@ -528,7 +528,7 @@ void Core::showLogo() { uint32_t now; uint8_t state=0; //jump directly to logo, bypass teeth - uint16_t counter=0, i=0; + uint16_t i=0; uint16_t sc; while (state < 255/6) { now=getTime(); @@ -586,11 +586,11 @@ } void Core::titleScreen(const uint8_t* logo){ - titleScreen(F(""), logo); + titleScreen((""), logo); } void Core::titleScreen(){ - titleScreen(F("")); + titleScreen(("")); } void Core::titleScreen(const char* name, const uint8_t *logo){ @@ -620,16 +620,16 @@ display.cursorX = LCDWIDTH - display.fontWidth*3 -1; display.cursorY = LCDHEIGHT - display.fontHeight*3 - 3; if((frameCount/16)%2) - display.println(F("\25 \20")); + display.println(("\25 \20")); else - display.println(F("\25\20 ")); + display.println(("\25\20 ")); //B button display.cursorX = LCDWIDTH - display.fontWidth*3 - 1; display.cursorY++; if(sound.globalVolume) - display.println(F("\26\23\24")); + display.println(("\26\23\24")); else - display.println(F("\26\23x")); + display.println(("\26\23x")); //C button display.cursorX = LCDWIDTH - display.fontWidth*3 - 1; display.cursorY++; @@ -706,9 +706,9 @@ backlight.set(0); display.clear(); display.fontSize = 1; - display.print(F("LOW BATTERY\n")); + display.print(("LOW BATTERY\n")); display.print(battery.voltage); - display.print(F("mV\n\nPLEASE\nTURN OFF")); + display.print(("mV\n\nPLEASE\nTURN OFF")); display.update(); break; case 1: //empty battery @@ -801,9 +801,6 @@ display.cursorX = 0; display.cursorY = currentY; display.textWrap = false; - uint16_t fc,bc; - fc = display.color; - bc = display.bgcolor; //getFirstFile(ext); for (int i = 0; i<20; i++) { display.invisiblecolor=255; @@ -830,6 +827,7 @@ } // draw menu loop } // update } + return 0; } char* Core::filemenu() { @@ -901,6 +899,7 @@ #else return 0; #endif + return 0; } void Core::keyboard(char* text, uint8_t length) { @@ -978,9 +977,9 @@ while (1) { if (update()) { //display.setCursor(0,0); - display.println(F("You entered\n")); + display.println(("You entered\n")); display.print(text); - display.println(F("\n\n\n\x15:okay \x16:edit")); + display.println(("\n\n\n\x15:okay \x16:edit")); if(buttons.pressed(BTN_A)){ sound.playOK(); return; @@ -1001,15 +1000,15 @@ //draw instruction display.cursorX = currentX-display.fontWidth*6-2; display.cursorY = currentY+1*(display.fontHeight+1); - display.print(F("\25type")); + display.print(("\25type")); display.cursorX = currentX-display.fontWidth*6-2; display.cursorY = currentY+2*(display.fontHeight+1); - display.print(F("\26back")); + display.print(("\26back")); display.cursorX = currentX-display.fontWidth*6-2; display.cursorY = currentY+3*(display.fontHeight+1); - display.print(F("\27save")); + display.print(("\27save")); //erase some pixels around the selected character display.setColor(WHITE);