Exemple #1
0
	def __getitem__(self, pos):
		"""Return the 24-bit RGB color value at the provided position or slice
		of positions.
		"""
		# Handle if a slice of positions are passed in by grabbing all the values
		# and returning them in a list.
		if isinstance(pos, slice):
			return [ws.ws2811_led_get(self.channel, n) for n in range(pos.indices(self.size))]
		# Else assume the passed in value is a number to the position.
		else:
			return ws.ws2811_led_get(self.channel, pos)
 def __getitem__(self, pos):
     """Return the 24-bit RGB color value at the provided position or slice
     of positions.
     """
     # Handle if a slice of positions are passed in by grabbing all the values
     # and returning them in a list.
     if isinstance(pos, slice):
         return [ws.ws2811_led_get(self.channel, n) for n in range(pos.indices(self.size))]
     # Else assume the passed in value is a number to the position.
     else:
         return ws.ws2811_led_get(self.channel, pos)
Exemple #3
0
def ws2811_led_get(*args):
    return _rpi_ws281x.ws2811_led_get(*args)
Exemple #4
0
 def get_led(self, n):
     return ws.ws2811_led_get(self._channel, n % self.size)
Exemple #5
0
def ws2811_led_get(channel, lednum):
    return _rpi_ws281x.ws2811_led_get(channel, lednum)
Exemple #6
0
def ws2811_led_get(*args):
  return _rpi_ws281x.ws2811_led_get(*args)