Difference between revisions of "Gb.getDefaultName"

From Gamebuino Wiki
Jump to: navigation, search
m (Example: added name in begin())
(Example: source from github)
Line 14: Line 14:
  
 
== Example ==
 
== Example ==
<pre>
+
<gistit>https://github.com/Rodot/Gamebuino/blob/master/libraries/Gamebuino/examples/5.Reference/core/getDefaultName/getDefaultName.ino</gistit>
#include <SPI.h>
 
#include <Gamebuino.h>
 
Gamebuino gb;
 
 
 
char name[11];
 
 
 
void setup(){
 
  gb.begin(F("Name example"));
 
  gb.getDefaultName(name);
 
}
 
 
 
void loop(){
 
  if(gb.update()){
 
    gb.display.print("Hello ");
 
    gb.display.print(name);
 
  }
 
}
 
</pre>
 
  
 
== See also ==
 
== See also ==
 
*[[bootloader]]
 
*[[bootloader]]
 
*[http://arduino.cc/en/Reference/String string (Arduino reference)]
 
*[http://arduino.cc/en/Reference/String string (Arduino reference)]

Revision as of 2014-05-19T09:34:40


Description

Gets the default user name set using the program SETTINGS.HEX. The default name is set in the Gamebuino's memory so it's the same in every game.

Syntax

gb.getDefaultName(name);

Parameters

  • name (char*): a 10 char long string which will receive the default user name.

Returns

none

Example

See also