Package voltage.utility

# Class ClockDivider

java.lang.Object
voltage.utility.ClockDivider

public class ClockDivider extends Object
A simple class that takes an input signal and uses it as a clock Each time the signal passes -2.5 or 2.5, it flips a gate.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ClockDivider()`
  Creates a ClockDivider object

- ## Method Summary

  Modifier and Type
  Method
  Description
  `double`
  `ProcessSample(double clockInput)`
  Processes one sample
  `void`
  `Reset()`
  Resets the ClockDivider
  `void`
  `SetDivisor(int divisor)`
  Sets a divisor to flip the gate.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ClockDivider

    public ClockDivider()
    Creates a ClockDivider object

- ## Method Details

  - ### SetDivisor

    public void SetDivisor(int divisor)
    Sets a divisor to flip the gate.
    Parameters:
      `divisor` - The gate is flipped every 'divisor' times. For example, if you set this to 2 and feed in a pulse wave signal, it will generate a square wave at half the original frequency.

  - ### Reset

    public void Reset()
    Resets the ClockDivider

  - ### ProcessSample

    public double ProcessSample(double clockInput)
    Processes one sample
    Parameters:
      `clockInput` - the input sample of a clock like signal.
    Returns:
      returns 5.0 if the clock is on and 0.0 if it's off.