Beispiel #1
0
 def nameHand(self, p, name):
     """ give/change the name of this poor hand on port p! """
     # open SPI device for find mode
     self._SPI.open(0, self._MODE['find'])
     # select a port
     self.__select_port(p)
     Hand.registerPalms(self._SPI, name)
Beispiel #2
0
 def findHands(self):
     """ Scan for controllers. """
     # Open SPI device for find mode
     self._SPI.open(0, self._MODE['find'])
     # Scan each identity port (ports 0-7, CS 1)
     for port in xrange(0, self.MAX_PLAYERS):
         # select a port
         self.__select_port(port)
         # read value at port (TODO: talk to SPI flash IC)
         #data = self._readADC(0)
         # check for a known hand type.
         identity = Hand.readPalms(self._SPI)
         print "name:\t%s" % identity
         time.sleep(0.5)