Skip to content

Commit

Permalink
修改Arduino可编程手柄文档
Browse files Browse the repository at this point in the history
  • Loading branch information
LT000-ops committed Aug 15, 2024
1 parent 18b68ee commit b860268
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ enum ButtonType : uint8_t {
kButtonD = 8,
kButtonMax,
};
//这里只用直接调用你需要判断的按键类型,即可。比如说判断手柄端的A键是否按下,就只用输入emakefun::GamepadModel::kButtonA就行,其他按键的判断按照这样的参数修改ButtonType类型即可。
```
#### g_gamepad_model.Tick()
Expand Down Expand Up @@ -479,20 +480,32 @@ bool ButtonReleased(const ButtonType button_type) const {

#### 获取摇杆和重力加速度的值

摇杆:
**摇杆**

获取X轴上的摇杆值:

`GetJoystickCoordinate().x`

获取Y轴上的摇杆值:

`GetJoystickCoordinate().y`

重力加速度:
**重力加速度**

获取X轴上重力加速度值:

`g_gamepad_model.GetGravityAcceleration().x`

获取Y轴上重力加速度值:

`g_gamepad_model.GetGravityAcceleration().y`

获取Z轴上重力加速度值:

`g_gamepad_model.GetGravityAcceleration().z`



以上函数直接调用即可

若遇上解决不了的问题
Expand Down

This file was deleted.

0 comments on commit b860268

Please sign in to comment.