Embed: (wiki syntax)

« Back to documentation index

USBRawHID Class Reference

USBRawHID Class Reference

USB device: a relative mouse. More...

#include <USBRawHID.h>

Inherits USBHID.

Public Member Functions

 USBRawHID ()
 Constructor for a USBMouse (relative mouse)

Detailed Description

USB device: a relative mouse.

Warning: you can only instantiate one instance of a USB device: USBMouse, USBKeyboard, USBAbsMouse, USBMouseKeyboard, or USBAbsMouseKeyboard.

Example:

 #include "mbed.h"
 #include "USBMouse.h"

 USBMouse mouse;

 #define STEP (2)
 #define SIZE (100)

 int main(void)
 {
   int32_t a;

   while (1)
   {
       for (a=0; a<SIZE; a++)
       {
            mouse.move(STEP,0);
       }

       for (a=0; a<SIZE; a++)
       {
            mouse.move(0,STEP);
       }

       for (a=0; a<SIZE; a++)
       {
            mouse.move(-STEP,0);
       }

       for (a=0; a<SIZE; a++)
       {
            mouse.move(0,-STEP);
       }
   }
 }

Definition at line 54 of file USBRawHID.h.


Constructor & Destructor Documentation

USBRawHID (  )

Constructor for a USBMouse (relative mouse)

Definition at line 61 of file USBRawHID.h.