Package drawing

Class Marker

java.lang.Object
drawing.Marker

public final class Marker extends Object
This is a singleton for the Pen object .
Since:
2023
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    This uses the touchSensor to calibrate the pen on its Vertical axis as well putting the pen back up.This is done by moving the motor until it touches the sensor.
    static Marker
    This gets the instance of Marker and returns it.
    static void
    This method causes the robot to move backwards up until the colourSensor detects a black line past a certain TachoCount threshold.
    static void
    This moves the robot backwards.
    static boolean
    This checks if the angle of gyroSensor past a certain threshold.
    static void
    Closes all motors and sensors.
    static void
    markerDiagonalLR(int horizontalRotate, int fowardsRotate)
    This uses a horizontal and forwards input in order to draw from Left to Right diagonally by synching the motors and moving them at the same time.
    static void
    markerDiagonalRL(int horizontalRotate, int forwardsRotate)
    This uses a horizontal and forwards input in order to draw from Left to Right diagonally by synching the motors and moving them at the same time.
    static void
    This puts the pen down by rotating it negatively.
    static int
    Returns the tachoCount of the forwards motor
    static void
    markerHorizontal(int forwardsRotate)
    This moves the pen Horizontally by the forwards rate.
    static void
    Method which gets the instances' of the Motor and Sensor singletons.
    static void
    This stops the motor from moving forwards.
    static void
    This puts the pen up by rotating it positively.
    static void
    markerVertical(int horizontalRotate)
    This moves the pen vertically by the horizontal rate.

    Methods inherited from class java.lang.Object

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

    • getInstance

      public static Marker getInstance()
      This gets the instance of Marker and returns it. Checks if its null, which creates a new Instance.
      Returns:
      none
    • markerOpen

      public static void markerOpen()
      Method which gets the instances' of the Motor and Sensor singletons.
    • markerClose

      public static void markerClose()
      Closes all motors and sensors.
    • calibrate

      public static void calibrate()
      This uses the touchSensor to calibrate the pen on its Vertical axis as well putting the pen back up.This is done by moving the motor until it touches the sensor.
    • markerUp

      public static void markerUp()
      This puts the pen up by rotating it positively.
    • markerDown

      public static void markerDown()
      This puts the pen down by rotating it negatively.
    • markerVertical

      public static void markerVertical(int horizontalRotate)
      This moves the pen vertically by the horizontal rate.
      Parameters:
      horizontalRotate -
    • markerBackwards

      public static void markerBackwards()
      This moves the robot backwards.
    • markerStop

      public static void markerStop()
      This stops the motor from moving forwards.
    • markerHorizontal

      public static void markerHorizontal(int forwardsRotate)
      This moves the pen Horizontally by the forwards rate.
      Parameters:
      forwardsRotate -
    • markerDiagonalLR

      public static void markerDiagonalLR(int horizontalRotate, int fowardsRotate)
      This uses a horizontal and forwards input in order to draw from Left to Right diagonally by synching the motors and moving them at the same time.
      Parameters:
      horizontalRotate -
      fowardsRotate -
    • markerDiagonalRL

      public static void markerDiagonalRL(int horizontalRotate, int forwardsRotate)
      This uses a horizontal and forwards input in order to draw from Left to Right diagonally by synching the motors and moving them at the same time.
      Parameters:
      horizontalRotate -
      forwardsRotate -
    • markerBeepGyro

      public static boolean markerBeepGyro()
      This checks if the angle of gyroSensor past a certain threshold.
      Returns:
      boolean
    • markerGetTachoCount

      public static int markerGetTachoCount()
      Returns the tachoCount of the forwards motor
      Returns:
      int
    • markerBackUp

      public static void markerBackUp()
      This method causes the robot to move backwards up until the colourSensor detects a black line past a certain TachoCount threshold.