Browse Source

Reduced minimum weight for player detection to 10 kg

master
klonfish 7 years ago
parent
commit
fbe4fd49ba
  1. 4
      wii-pair/daemon.py

4
wii-pair/daemon.py

@ -15,6 +15,8 @@ known_boards = {'niklas': '00:26:59:34:C8:69',
'fed': '00:23:CC:23:5E:1D', 'fed': '00:23:CC:23:5E:1D',
} }
MIN_WEIGHT = 10
class StatusThread(Thread): class StatusThread(Thread):
def __init__(self, t1, t2): def __init__(self, t1, t2):
Thread.__init__(self) Thread.__init__(self)
@ -108,7 +110,7 @@ class WiiThread(Thread):
while not self.stop and self.board.status == 'Connected': while not self.stop and self.board.status == 'Connected':
self.weight = self.board.mass.totalWeight self.weight = self.board.mass.totalWeight
if self.board.mass.totalWeight > 15: if self.board.mass.totalWeight >= MIN_WEIGHT:
m = self.board.mass m = self.board.mass
x_balance = -(m.topLeft+m.bottomLeft) + (m.topRight+m.bottomRight) x_balance = -(m.topLeft+m.bottomLeft) + (m.topRight+m.bottomRight)
x_balance = x_balance/float(m.totalWeight) x_balance = x_balance/float(m.totalWeight)

Loading…
Cancel
Save