Loading...

Reference.GetXChange History

Hide minor edits - Show changes to markup

October 20, 2012, at 11:13 AM by Scott Fitzgerald -
Changed lines 7-8 from:

Reports the relative amount of movement of a mouse on the X-axis since the last time polled. A positive number indicates a downward movement, a negative number indicates upward movement.

to:

Reports the relative amount of movement of a mouse on the X-axis since the last time polled. A positive number indicates movement to the right, a negative number indicates movement to the left.

October 16, 2012, at 02:48 PM by Scott Fitzgerald -
Added lines 1-51:

USBHost : MouseController class

getXChange()

Description

Reports the relative amount of movement of a mouse on the X-axis since the last time polled. A positive number indicates a downward movement, a negative number indicates upward movement.

Syntax

mouse.getXChange()

Parameters

none

Returns

int

Example

(:source lang=arduino tabwidth=4:)

  1. include <MouseController.h>

// Initialize USB Controller USBHost usb;

// Attach mouse controller to USB MouseController mouse(usb);

void mouseMoved() {

  Serial.print("Move: ");
  Serial.print(mouse.getXChange());
  Serial.print(", ");
  Serial.println(mouse.getYChange());

}

void setup(){

  Serial.begin(9600);

}

void loop(){

  usb.Task();

} (:sourceend:)

See Also




Bookmark and Share