Class CRICKITHat
-
- All Implemented Interfaces:
-
com.diozero.api.DeviceInterface,java.lang.AutoCloseable
public final class CRICKITHat implements DeviceInterfaceA 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.
-
-
Field Summary
Fields Modifier and Type Field Description private final AdafruitSeeSawseeSaw
-
Constructor Summary
Constructors Constructor Description CRICKITHat(I2CDevice i2CDevice, Boolean initReset)CRICKITHat(I2CDevice i2CDevice)CRICKITHat()CRICKITHat(AdafruitSeeSaw seeSaw)
-
Method Summary
Modifier and Type Method Description final AdafruitSeeSawgetSeeSaw()final DigitalInputDevicesignalDigitalIn(Integer pin)Convenience function to get a digital input on the Signal port pin (1-8). final DigitalOutputDevicesignalDigitalOut(Integer pin)Convenience function to get a digital output on the Signal port pin (1-8) final AnalogInputDevicesignalAnalogIn(Integer pin)Convenience function to get an analog input on the Signal port pin (1-8) final DigitalInputDevicetouchDigitalIn(Integer pin)Convenience function to get a digital input on one of the touchpads. final AnalogInputDevicetouchAnalogIn(Integer pin)Convenience function to get an analog input on one of the touchpads. final ServoDeviceservo(Integer pin, ServoTrim servoTrim)Convenience function to get a servo device on the Servo ports pin (1-4) final PwmMotormotor(Integer index)Convenience function to use the Motor ports for bidirectional motors, where index is the motor number (1 or 2). final PwmOutputDevicedrive(Integer index)Convenience function to get PWM-able outputs. final BasicStepperControllerunipolarStepperPort()Get the unipolar stepper controller from the DRIVEports.final BasicStepperControllermotorStepperPort()Get a controller from the motor ports. final NeoPixelneoPixel(Integer numPixels, Integer bitsPerPixel)Convenience function to use the NeoPixel port. final <Error class: unknown class>statusPixel()Convenience function to access the on-board status NeoPixel. Unitclose()-
-
Constructor Detail
-
CRICKITHat
CRICKITHat(I2CDevice i2CDevice, Boolean initReset)
-
CRICKITHat
CRICKITHat(I2CDevice i2CDevice)
-
CRICKITHat
CRICKITHat()
-
CRICKITHat
CRICKITHat(AdafruitSeeSaw seeSaw)
-
-
Method Detail
-
getSeeSaw
final AdafruitSeeSaw getSeeSaw()
-
signalDigitalIn
final DigitalInputDevice signalDigitalIn(Integer pin)
Convenience function to get a digital input on the Signal port pin (1-8). This uses GpioPullUpDown.PULL_UP so the inputs are reversed from what one would expect.
-
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
DRIVEports. 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
diozeroWS2811 but an implementation from this library.
-
statusPixel
final <Error class: unknown class> statusPixel()
Convenience function to access the on-board status NeoPixel. Note that this is not a
diozeroWS2811 but an implementation from this library.
-
-
-
-