Class CRICKITHat

  • All Implemented Interfaces:
    com.diozero.api.DeviceInterface , java.lang.AutoCloseable

    
    public final class CRICKITHat
     implements DeviceInterface
                        

    A device factory for the AdaFruit CRICKIT.

    It is HIGHLY recommended to use the convenience functions instead of creating devices via the builders or constructors as the pin numbering gets a little odd.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final AdafruitSeeSaw getSeeSaw()
      final DigitalInputDevice signalDigitalIn(Integer pin, Boolean pullDown) Convenience function to get a digital input on the Signal port pin (1-8), with optional pullDown
      final DigitalOutputDevice signalDigitalOut(Integer pin) Convenience function to get a digital output on the Signal port pin (1-8)
      final AnalogInputDevice signalAnalogIn(Integer pin) Convenience function to get an analog input on the Signal port pin (1-8)
      final DigitalInputDevice touchDigitalIn(Integer pin) Convenience function to get a digital input on one of the touchpads.
      final AnalogInputDevice touchAnalogIn(Integer pin) Convenience function to get an analog input on one of the touchpads.
      final ServoDevice servo(Integer pin, ServoTrim servoTrim) Convenience function to get a servo device on the Servo ports pin (1-4)
      final PwmMotor motor(Integer index) Convenience function to use the Motor ports for bidirectional motors, where index is the motor number (1 or 2).
      final PwmOutputDevice drive(Integer index) Convenience function to get PWM-able outputs.
      final BasicStepperController unipolarStepperPort() Get the unipolar stepper controller from the DRIVE ports.
      final BasicStepperController motorStepperPort() Get a controller from the motor ports.
      final NeoPixel neoPixel(Integer numPixels, Integer bitsPerPixel) Convenience function to use the NeoPixel port.
      final NeoPixel statusPixel() Convenience function to access the on-board status NeoPixel.
      Unit close()
      • Methods inherited from class java.lang.Object

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

      • CRICKITHat

        CRICKITHat(I2CDevice i2CDevice, Boolean initReset)
      • CRICKITHat

        CRICKITHat(I2CDevice i2CDevice)
      • CRICKITHat

        CRICKITHat()
    • Method Detail

      • signalDigitalOut

         final DigitalOutputDevice signalDigitalOut(Integer pin)

        Convenience function to get a digital output on the Signal port pin (1-8)

      • signalAnalogIn

         final AnalogInputDevice signalAnalogIn(Integer pin)

        Convenience function to get an analog input on the Signal port pin (1-8)

      • touchDigitalIn

         final DigitalInputDevice touchDigitalIn(Integer pin)

        Convenience function to get a digital input on one of the touchpads.

      • touchAnalogIn

         final AnalogInputDevice touchAnalogIn(Integer pin)

        Convenience function to get an analog input on one of the touchpads.

      • servo

         final ServoDevice servo(Integer pin, ServoTrim servoTrim)

        Convenience function to get a servo device on the Servo ports pin (1-4)

      • motor

         final PwmMotor motor(Integer index)

        Convenience function to use the Motor ports for bidirectional motors, where index is the motor number (1 or 2). Note this is 5v.

      • drive

         final PwmOutputDevice drive(Integer index)

        Convenience function to get PWM-able outputs. Note this is 5v.

      • unipolarStepperPort

         final BasicStepperController unipolarStepperPort()

        Get the unipolar stepper controller from the DRIVE ports. Note this is 5v.

      • motorStepperPort

         final BasicStepperController motorStepperPort()

        Get a controller from the motor ports. Note this is 5v.

      • neoPixel

         final NeoPixel neoPixel(Integer numPixels, Integer bitsPerPixel)

        Convenience function to use the NeoPixel port. Note that this is not a diozero WS2811 but an implementation from this library.

      • statusPixel

         final NeoPixel statusPixel()

        Convenience function to access the on-board status NeoPixel. Note that this is not a diozero WS2811 but an implementation from this library.