Class WateringSystem


  • public class WateringSystem
    extends java.lang.Object
    This class represents the watering system of the greenhouse.
    • Constructor Summary

      Constructors 
      Constructor Description
      WateringSystem​(com.pi4j.io.gpio.Pin pin)
      Constructs a new WateringSystem.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void toggle()
      Toggle the watering system: if it is on, turn it off, and vice versa.
      void turnOff()
      Turns the watering system off.
      void turnOn()
      Turns the watering system on.
      void turnOnFor​(int milliseconds)
      Turns the watering system on for a certain amount of time (ms).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WateringSystem

        public WateringSystem​(com.pi4j.io.gpio.Pin pin)
        Constructs a new WateringSystem.
        Parameters:
        pin - The GPIO pin that controls the watering system.
    • Method Detail

      • turnOn

        public void turnOn()
        Turns the watering system on.
      • turnOff

        public void turnOff()
        Turns the watering system off.
      • turnOnFor

        public void turnOnFor​(int milliseconds)
        Turns the watering system on for a certain amount of time (ms).
        Parameters:
        milliseconds - The amount of time (ms) to turn the watering system on for.
      • toggle

        public void toggle()
        Toggle the watering system: if it is on, turn it off, and vice versa.