Skip to content

Commit

Permalink
Add install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
FeralAI committed Sep 19, 2021
1 parent 65623c3 commit 19f3ab9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
* [What is MPG?](#what-is-mpg)
* [Features](#features)
* [Usage](#usage)
* [Installation](#installation)
* [Arduino IDE](#arduino-ide)
* [PlatformIO](#platformio)
* [MPG Class](#mpg-class)
* [MPGS Class](#mpgs-class)
* [Buttons](#buttons)
Expand Down Expand Up @@ -31,6 +34,32 @@ MPG is a fast and flexible C++ library for managing gamepad inputs. The goal is

## Usage

### Installation

Download an MPG zip package from the [Releases](https://github.com/FeralAI/MPG/releases) section, then extract to a temp folder.

#### Arduino IDE

Place the extracted folder, e.g. `MPG-0.1.0`, in your Arduino Libraries folder. On Windows this will usually be in `C:\Users\%USERNAME%\Documents\Arduino\libraries`. Then open Arduino IDE and create a new sketch or load an example from `File > Examples > MPG`. A full 32u4 gamepad implementation and a naive benchmarking example sketches are included.

#### PlatformIO

You can either search the PIO Libraries tab for `MPG` or manually edit your `platformio.ini` to add MPG to the `lib_deps` property:

```ini
[env]
platform = wizio-pico
board = raspberry-pi-pico
framework = baremetal
build_type = release
build_flags =
-D PICO_USB
lib_deps =
feralai/MPG@^0.1.0
```

### Sample

There are two gamepad classes available: `MPG` and `MPGS`. The `MPG` class is the base class with all of the input handling and report conversion methods, while `MPGS` extends the base class with some additional methods for persisting gamepad options. The main file of an MPG application will look something like this:

```c++
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "MPG",
"version": "0.1.0",
"description": "C++ library for USB gamepad handling with support for XInput, DirectInput and Nintendo Switch.",
"keywords": "c++ baremetal gamepad hid dinput directinput switch xinput",
"keywords": ["c++", "baremetal", "gamepad", "hid", "dinput", "directinput", "switch", "xinput"],
"authors": [
{
"name": "FeralAI",
Expand Down

0 comments on commit 19f3ab9

Please sign in to comment.