You are viewing an older revision! See the latest version

USBKeyboard

Table of Contents

  1. Hello World
  2. API
  3. Related

Beta only!

This library is in beta, and only works with the betamode compiler and the beta libraries.

To use these, ensure you have enabled /betamode for the compiler, and that you import these examples as the basis for your experiments to ensure the beta mbed library is pulled in.

The USBKeyboard interface is used to emulate a keyboard over the USB port. You can send basic keys, keys with modifiers (CTRL + 's'), function keys and media keys

USB pins are available on p31 (D+) and p32 (D-)

Hello World

#include "mbed.h"
#include "USBKeyboard.h"

USBKeyboard keyboard;

int main(void) {
    while (1) {
        keyboard.mediaControl(KEY_VOLUME_DOWN);
        keyboard.printf("Hello World from Mbed\r\n");
        wait(1);
    }
}

Import programUSBKeyboard_HelloWorld

USBKeyboard Hello World

API

[Not converted]

USBHID
USBMouse
USBMouseKeyboard


All wikipages