Package behaviors

Class BatteryLevel

java.lang.Object
behaviors.BatteryLevel
All Implemented Interfaces:
lejos.robotics.subsumption.Behavior

public class BatteryLevel extends Object implements lejos.robotics.subsumption.Behavior
Checks whether the battery level is low, if it is exits the program.
Since:
2023
  • Constructor Summary

    Constructors
    Constructor
    Description
    Null battery level constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Action displays on the screen that the battery is low waits and then exits the program.
    void
    Suppress function does nothing here.
    boolean
    Take control returns true when the battery level is below 7 volts.

    Methods inherited from class java.lang.Object

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

    • BatteryLevel

      public BatteryLevel()
      Null battery level constructor
  • Method Details

    • action

      public void action()
      Action displays on the screen that the battery is low waits and then exits the program.
      Specified by:
      action in interface lejos.robotics.subsumption.Behavior
    • suppress

      public void suppress()
      Suppress function does nothing here.
      Specified by:
      suppress in interface lejos.robotics.subsumption.Behavior
    • takeControl

      public boolean takeControl()
      Take control returns true when the battery level is below 7 volts.
      Specified by:
      takeControl in interface lejos.robotics.subsumption.Behavior
      Returns:
      boolean