Examples, closing controller HID device on close function

This commit is contained in:
Florian Kaiser
2020-11-29 19:40:37 +01:00
parent a353bb006a
commit 2f5579cc49
5 changed files with 59 additions and 23 deletions

15
examples/leds.py Normal file
View File

@@ -0,0 +1,15 @@
from pydualsense import *
# get dualsense instance
dualsense = pydualsense()
# set color around touchpad to red
dualsense.setColor(0,0,255)
# enable microphone indicator
dualsense.setMicrophoneLED(1)
# set all player indicators on
dualsense.setPlayer(PlayerID.all)
# sleep a little to see the result on the controller
# this is not needed in normal usage
import time; time.sleep(2)
# terminate the thread for message and close the device
dualsense.close()