PS2_esp32_control
for esp32
(basic) from the example
first include the lib
1 |
define the pin
1 |
mode select
- select modes of PS2 controller:
- pressures = analog reading of push-butttons
- rumble = motor rumbling 震动
- uncomment 1 of the lines for each mode selection
1 |
normal plan
1 | PS2X ps2x; // create PS2 Controller Class |
initialization
1 | while (error != 0) { |
read the value plan
first
1 | ps2x.read_gamepad(false, vibrate); //read controller and set large motor to spin at 'vibrate' speed |
read
1 | //will be TRUE as long as button is pressed |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 steve_life!
评论