:py:mod:`phoenix6.controls.rainbow_animation` ============================================= .. py:module:: phoenix6.controls.rainbow_animation Module Contents --------------- .. py:class:: RainbowAnimation(led_start_index: int, led_end_index: int, slot: int = 0, brightness: float = 1.0, direction: AnimationDirectionValue = AnimationDirectionValue.FORWARD, frame_rate: phoenix6.units.hertz = 100) Animation that creates a rainbow throughout all the LEDs. :param led_start_index: The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip If the start index is greater than the end index, the direction will be reversed. The direction can also be changed using the Direction parameter. :type led_start_index: int :param led_end_index: The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip. If the end index is less than the start index, the direction will be reversed. The direction can also be changed using the Direction parameter. :type led_end_index: int :param slot: The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation. :type slot: int :param brightness: The brightness of the animation, as a scalar from 0.0 to 1.0. :type brightness: float :param direction: The direction of the animation. :type direction: AnimationDirectionValue :param frame_rate: The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation. A frame is defined as a transition in the state of the LEDs, advancing the rainbow by about 3 degrees of hue (out of 360 degrees). :type frame_rate: hertz .. py:property:: name :type: str Gets the name of this control request. :returns: Name of the control request :rtype: str .. py:property:: control_info :type: dict Gets information about this control request. :returns: Dictonary of control parameter names and corresponding applied values :rtype: dict .. py:attribute:: update_freq_hz :type: phoenix6.units.hertz :value: 20 The period at which this control will update at. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls. .. py:attribute:: led_start_index The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip If the start index is greater than the end index, the direction will be reversed. The direction can also be changed using the Direction parameter. .. py:attribute:: led_end_index The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip. If the end index is less than the start index, the direction will be reversed. The direction can also be changed using the Direction parameter. .. py:attribute:: slot The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation. .. py:attribute:: brightness The brightness of the animation, as a scalar from 0.0 to 1.0. .. py:attribute:: direction The direction of the animation. .. py:attribute:: frame_rate The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation. A frame is defined as a transition in the state of the LEDs, advancing the rainbow by about 3 degrees of hue (out of 360 degrees). - Units: Hz .. py:method:: with_led_start_index(new_led_start_index: int) -> RainbowAnimation Modifies this Control Request's led_start_index parameter and returns itself for method-chaining and easier to use request API. The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip If the start index is greater than the end index, the direction will be reversed. The direction can also be changed using the Direction parameter. :param new_led_start_index: Parameter to modify :type new_led_start_index: int :returns: Itself :rtype: RainbowAnimation .. py:method:: with_led_end_index(new_led_end_index: int) -> RainbowAnimation Modifies this Control Request's led_end_index parameter and returns itself for method-chaining and easier to use request API. The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip. If the end index is less than the start index, the direction will be reversed. The direction can also be changed using the Direction parameter. :param new_led_end_index: Parameter to modify :type new_led_end_index: int :returns: Itself :rtype: RainbowAnimation .. py:method:: with_slot(new_slot: int) -> RainbowAnimation Modifies this Control Request's slot parameter and returns itself for method-chaining and easier to use request API. The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation. :param new_slot: Parameter to modify :type new_slot: int :returns: Itself :rtype: RainbowAnimation .. py:method:: with_brightness(new_brightness: float) -> RainbowAnimation Modifies this Control Request's brightness parameter and returns itself for method-chaining and easier to use request API. The brightness of the animation, as a scalar from 0.0 to 1.0. :param new_brightness: Parameter to modify :type new_brightness: float :returns: Itself :rtype: RainbowAnimation .. py:method:: with_direction(new_direction: AnimationDirectionValue) -> RainbowAnimation Modifies this Control Request's direction parameter and returns itself for method-chaining and easier to use request API. The direction of the animation. :param new_direction: Parameter to modify :type new_direction: AnimationDirectionValue :returns: Itself :rtype: RainbowAnimation .. py:method:: with_frame_rate(new_frame_rate: phoenix6.units.hertz) -> RainbowAnimation Modifies this Control Request's frame_rate parameter and returns itself for method-chaining and easier to use request API. The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation. A frame is defined as a transition in the state of the LEDs, advancing the rainbow by about 3 degrees of hue (out of 360 degrees). - Units: Hz :param new_frame_rate: Parameter to modify :type new_frame_rate: hertz :returns: Itself :rtype: RainbowAnimation .. py:method:: with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) -> RainbowAnimation Sets the period at which this control will update at. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls. :param new_update_freq_hz: Parameter to modify :type new_update_freq_hz: hertz :returns: Itself :rtype: RainbowAnimation