Loading...

Reference.GetKey History

Hide minor edits - Show changes to markup

October 20, 2012, at 11:18 AM by Scott Fitzgerald -
Added lines 35-39:

void keyPressed(){

 Serial.write(keyboard.getKey());
 Serial.println();

}

Changed lines 42-43 from:
  Serial.write(keyboard.getKey());
  Serial.println();
to:
October 20, 2012, at 11:15 AM by Scott Fitzgerald -
Changed lines 7-8 from:

Reports the ASCII value of a key being pressed on an attached USB keyboard.

to:

Reports the ASCII value of a key being pressed or released on an attached USB keyboard.

October 16, 2012, at 03:40 PM by Scott Fitzgerald -
Changed lines 11-12 from:

mouse.getKey()

to:

keyboard.getKey()

October 16, 2012, at 03:40 PM by Scott Fitzgerald -
Added lines 1-48:

USBHost : KeyboardController class

getKey()

Description

Reports the ASCII value of a key being pressed on an attached USB keyboard.

Syntax

mouse.getKey()

Parameters

none

Returns

int : the ASCII value of the key being pressed

Example

(:source lang=arduino tabwidth=4:)

  1. include <KeyboardController.h>

// Initialize USB Controller USBHost usb;

// Attach Keyboard controller to USB KeyboardController keyboard(usb);

void setup(){

  Serial.begin(9600);

}

void loop(){

  usb.Task();
  Serial.write(keyboard.getKey());
  Serial.println();

} (:sourceend:)

See Also




Bookmark and Share