-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
manualpair.py
26 lines (24 loc) · 775 Bytes
/
manualpair.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import sys
import os
import time
add_dir = '{}/../psmoveapi/build/'.format(os.getcwd())
sys.path.insert(0, add_dir)
import psmove
import pair
pairObj = pair.Pair()
exit = False
while not exit:
connected = psmove.count_connected()
input("Connect Moves via USB and press Enter.\nOr disconnect all USB Moves and press Enter to quit.")
print("Moves connected: %d" % connected)
moves = [psmove.PSMove(x) for x in range(connected)]
exit = True
for move in moves:
print("Move %s connected via %s" % (move.get_serial(), ['Bluetooth','USB'][move.connection_type]))
move.poll()
print("Temperature is %d" % move.get_temperature())
if move.connection_type == psmove.Conn_USB:
pairObj.pair_move(move)
move.set_leds(100,100,100)
exit = False
move.update_leds()