Difference between revisions of "Gb.keyboard"

From Gamebuino Wiki
Jump to: navigation, search
(page creation)
 
m (Changed title depth)
Line 1: Line 1:
 
{{DISPLAYTITLE:gb.keyboard}}
 
{{DISPLAYTITLE:gb.keyboard}}
 
__NOTOC__
 
__NOTOC__
= Description =
+
== Description ==
 
Displays a keyboard for the user to input some text.
 
Displays a keyboard for the user to input some text.
  
= Syntax =
+
== Syntax ==
 
<pre>gb.keyboard(string, length);</pre>
 
<pre>gb.keyboard(string, length);</pre>
  
= Parameters =
+
== Parameters ==
 
* string (char*): the string that will receive the text written by the user.
 
* string (char*): the string that will receive the text written by the user.
 
* length (byte): the maximum length of the text the user can input.
 
* length (byte): the maximum length of the text the user can input.
  
= Returns =
+
== Returns ==
 
none
 
none
  
= Example =
+
== Example ==
 
<pre>
 
<pre>
 
#include <SPI.h>
 
#include <SPI.h>
Line 35: Line 35:
 
</pre>
 
</pre>
  
= See also =
+
== See also ==
 
*[http://arduino.cc/en/Reference/String string (Arduino reference)]
 
*[http://arduino.cc/en/Reference/String string (Arduino reference)]

Revision as of 2014-05-18T10:01:11


Description

Displays a keyboard for the user to input some text.

Syntax

gb.keyboard(string, length);

Parameters

  • string (char*): the string that will receive the text written by the user.
  • length (byte): the maximum length of the text the user can input.

Returns

none

Example

#include <SPI.h>
#include <Gamebuino.h>
Gamebuino gb;

char text[13] = "Default text";

void setup(){
  gb.begin();
  gb.keyboard(text, 12);
}

void loop(){
  if(gb.update()){
    gb.display.println(F("You wrote:"));
    gb.display.println(text);
  }
}

See also