001/* Copyright (C) Cross The Road Electronics 2024 */ 002package com.ctre.phoenix.led; 003 004/** 005 * Animation that looks similarly to a flame flickering 006 */ 007public class FireAnimation extends BaseStandardAnimation { 008 /** 009 * Constructor for a FireAnimation 010 * @param brightness How bright should the animation be [0, 1] 011 * @param speed How fast will the flame be processed at [0, 1] 012 * @param numLed How many LEDs is the CANdle controlling 013 * @param sparking The rate at which the Fire "Sparks" [0, 1] 014 * @param cooling The rate at which the Fire "Cools" along the travel [0, 1] 015 * @param reverseDirection True to reverse the animation direction, so instead of fire going "away" from the CANdle, it will go "toward" the CANdle. 016 * @param ledOffset Where to start the animation 017 */ 018 public FireAnimation(double brightness, double speed, int numLed, double sparking, double cooling, boolean reverseDirection, int ledOffset) { 019 super(0x65, brightness, speed, numLed, sparking, cooling, reverseDirection, ledOffset); 020 } 021 /** 022 * Constructor for a FireAnimation 023 * @param brightness How bright should the animation be [0, 1] 024 * @param speed How fast will the flame be processed at [0, 1] 025 * @param numLed How many LEDs is the CANdle controlling 026 * @param sparking The rate at which the Fire "Sparks" [0, 1] 027 * @param cooling The rate at which the Fire "Cools" along the travel [0, 1] 028 */ 029 public FireAnimation(double brightness, double speed, int numLed, double sparking, double cooling) { 030 this(brightness, speed, numLed, sparking, cooling, false, 0); 031 } 032 /** 033 * Constructor for a FireAnimation. 034 * Call individual setters to tune the parameters further 035 */ 036 public FireAnimation() { 037 this(1, 1, -1, 1, 1, false, 0); 038 } 039 /** 040 * Sets the sparking value of the FireAnimation 041 * @param sparking The rate at which the Fire "Sparks" [0, 1] 042 */ 043 public void setSparking(double sparking) { 044 setParam4(sparking); 045 } 046 /** 047 * Sets the cooling value of the FireAnimation 048 * @param cooling The rate at which the Fire "Cools" [0, 1] 049 */ 050 public void setCooling(double cooling) { 051 setParam5(cooling); 052 } 053}