コード例 #1
0
ファイル: neopixel.py プロジェクト: anthonyburdi/rpi_ws281x
	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)
コード例 #2
0
ファイル: rpi_ws281x.py プロジェクト: TrayserCassa/FutevTorch
 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)
コード例 #3
0
def ws2811_led_get(*args):
    return _rpi_ws281x.ws2811_led_get(*args)
コード例 #4
0
ファイル: LEDs.py プロジェクト: ZacharyACoon/zrgb
 def get_led(self, n):
     return ws.ws2811_led_get(self._channel, n % self.size)
コード例 #5
0
ファイル: rpi_ws281x.py プロジェクト: Q2MORY17/SSRSLauncher
def ws2811_led_get(channel, lednum):
    return _rpi_ws281x.ws2811_led_get(channel, lednum)
コード例 #6
0
ファイル: rpi_ws281x.py プロジェクト: DiNozzo97/smartHome
def ws2811_led_get(*args):
  return _rpi_ws281x.ws2811_led_get(*args)