Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
soonuse authored Apr 28, 2020
1 parent 13f7918 commit 3440247
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,16 @@ i.e.
```
04 00 08 80 80 80 80 00
```
- To press multiple buttons, you can use the operator "|" to put them together, e.g (Button.A | Button.B)
- To press multiple buttons, you can use the operator "|" to put them together, e.g. for the python examples:
```
report = UsbJoystickReport(buttons=Button.A | Button.B)
```
and for the C/C++:
```
USB_JoystickReport_Input joystick_input;
joystick_input.Button = SWITCH_A | SWITCH_B;
```

### How to convert USB report to the serial data
Then we should convert the USB report to the serial data to input.
It's not the same as the serial data but what's the relation ship of them?
Expand Down Expand Up @@ -116,4 +125,4 @@ python3 Example/spin.py
```
This script rock the left stick forever. In games, your hero will rotate its body.

The line of `port` for serial should be changed according to your serial device name. For Windows user, it seems like COM1, COM2, COM3 ... on Device Manager. For Linux, you can find them by `ls -l / dev | grep ttyUSB`
The line of `port` for serial should be changed according to your serial device name. For Windows user, it seems like COM1, COM2, COM3 ... on Device Manager. For Linux, you can find them by `ls -l /dev | grep ttyUSB`

0 comments on commit 3440247

Please sign in to comment.