Exemplo n.º 1
0
    def __init__(self,
                 add_delay=1.0,
                 speed=14.0,
                 color=Color(rgb=(1, 1, 1)),
                 width=6.0,
                 reverse=False):
        """
    Args:
      color the color of the center (maximally intense part) of a pulse
      width the maximum number of LEDs affected by a pulse (diameter)
      add_delay the number of seconds between new pulses
      speed the number of LEDs down the strip a pulse travels / second
      reverse If True, pulses travel in the opposite direction; by
          default, the start from index 0.
    """
        Pattern.__init__(self)
        if add_delay <= 0:
            raise ValueError('add_delay value %s is not > 0.' % add_delay)
        if speed == 0:
            raise ValueError('speed value %s is 0.')
        if width <= 0:
            raise ValueError('width value %s is not > 0.' % width)
        self.__add_delay = float(add_delay)
        self.__speed = float(speed)
        self.__interval = self.__speed * self.__add_delay
        self.__radius = width / 2.0
        self.__reverse = reverse
        self.__color = color

        self.__t0 = None
Exemplo n.º 2
0
 def __init__(self, colorSequence, speed=1.0):
     if speed <= 0.0:
         raise ValueError("Illegal speed %s must be > 0." % speed)
     Pattern.__init__(self)
     Buffer.__init__(self, size=STRIP_LENGTH + 2)
     self.__seq = iter(colorSequence)
     self.__speed = speed
     self.__offset = 1.0
     self.__t = None
Exemplo n.º 3
0
 def __init__(self, color_sequence, speed=1.0):
     """
 Args:
   color_sequence an iterable of Color objects, to be scrolled. When
       the color_sequence runs out, the marquee will stop animating.
    speed the number of positions (LEDs) to advance in one second.
       For example, with a speed of 5, the first color from
       color_sequence will move (smoothly) from the start of the LED
       strip to the 5th LED.
 """
     if speed <= 0.0:
         raise ValueError('Illegal speed %s must be > 0.' % speed)
     Pattern.__init__(self)
     Buffer.__init__(self, size=STRIP_LENGTH + 2)
     self.__seq = iter(color_sequence)
     self.__speed = speed
     self.__offset = 1.0
     self.__t = None
Exemplo n.º 4
0
	def __init__(self, addDelay=1.0, speed=14.0,
			color=Color(rgb=(1,1,1)), width=6.0,
			reverse=False):
		Pattern.__init__(self)
		if addDelay <= 0:
			raise ValueError('addDelay value %s is not > 0.'
				% addDelay)
		if speed == 0:
			raise ValueError('speed value %s is 0.')
		if width <= 0:
			raise ValueError('width value %s is not > 0.'
				% width)
		self.__addDelay = float(addDelay)
		self.__speed = float(speed)
		self.__interval = self.__speed * self.__addDelay
		self.__radius = width/2.0
		self.__reverse = reverse
		self.__color = color

		self.__t0 = None
Exemplo n.º 5
0
 def __init__(self, color, opacity=0.0):
     Pattern.__init__(self)
     self.__color = color
     self.SetOpacity(opacity)
Exemplo n.º 6
0
	def __init__(self, color, opacity=0.0):
		Pattern.__init__(self)
		self.__color = color
		self.setOpacity(opacity)
Exemplo n.º 7
0
	def __init__(self):
		Pattern.__init__(self)
		self.__patterns = []
Exemplo n.º 8
0
 def __init__(self):
     Pattern.__init__(self)
     self.__patterns = []