File tree Expand file tree Collapse file tree
pi4micronaut-utils/src/main/java/com/opensourcewithslu/outputdevices Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ public class FanHelper {
1717 /**
1818 * Constructor to initialize the FanHelper with a PWM instance.
1919 *
20- * @param fa the PWM instance to control the fan
20+ * @param fan the PWM instance to control the fan
2121 */
22- public FanHelper (Pwm fa ) {
23- this .pwm = fa ;
22+ public FanHelper (Pwm fan ) {
23+ this .pwm = fan ;
2424 }
2525
2626 /**
@@ -48,7 +48,7 @@ public void stop() {
4848 /**
4949 * Sets the fan speed by adjusting the PWM duty cycle.
5050 *
51- * @param speed the desired fan speed (duty cycle), must be between 0 and 1024
51+ * @param speed the desired fan speed (duty cycle). Must be between 0 and 1024.
5252 * @throws IllegalArgumentException if the speed is out of bounds
5353 */
5454 public void setSpeed (int speed ) {
@@ -58,4 +58,4 @@ public void setSpeed(int speed) {
5858 log .info ("Setting fan speed to {}" , speed );
5959 pwm .on (speed ); // Adjust the duty cycle based on the speed
6060 }
61- }
61+ }
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ public void disable()
6464 * Sets the speed of the DC motor.
6565 * This method calculates the necessary pulse width and duty cycle to achieve the specified speed.
6666 *
67- * @param speed the target speed for the motor, as a percentage between 0 and 1 .
67+ * @param speed the target speed for the motor, as a percentage between 0 and 100 .
6868 */
6969 //tag::[method]
7070 public void setSpeed (double speed )
You can’t perform that action at this time.
0 commit comments