Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions examples/multi-controllers-selector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from pydualsense import *

import time

# get dualsense instance
dualsense = pydualsense()
dualsense.init()

dualsense.setController.choose(0) # choose controller 1
time.sleep(0.01) # sleep a little to see the result on the controller
dualsense.light.setColorI(0, 255, 0) # set color around touchpad to red
dualsense.light.setPlayerID(PlayerID.PLAYER_1) # set all player 1 indicator on
time.sleep(2) # sleep a little to see the result on the controller, this is not needed in normal usage

dualsense.setController.choose(1) # choose controller 2
time.sleep(0.01)
dualsense.light.setColorI(255, 0, 0)# set color around touchpad to green
dualsense.light.setPlayerID(PlayerID.PLAYER_2) # set all player 2 indicator on
time.sleep(2)

dualsense.close() # terminate the thread for message and close the device
Loading