java.lang.Object
com.pi4j.crowpi.components.Component
- Direct Known Subclasses:
ButtonComponent,ButtonMatrixComponent,BuzzerComponent,HT16K33,HumiTempComponent,IrReceiverComponent,LcdDisplayComponent,LightSensorComponent,MAX7219,MCP23008,MFRC522,PirMotionSensorComponent,RelayComponent,ServoMotorComponent,SoundSensorComponent,StepMotorComponent,TiltSensorComponent,TouchSensorComponent,UltrasonicDistanceSensorComponent,VibrationMotorComponent
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidsleep(long milliseconds) Utility function to sleep for the specified amount of milliseconds.protected voidtriggerSimpleEvent(SimpleEventHandler handler) Utility function to trigger a simple event handler.
-
Field Details
-
logger
Logger instance
-
-
Constructor Details
-
Component
public Component()
-
-
Method Details
-
sleep
protected void sleep(long milliseconds) Utility function to sleep for the specified amount of milliseconds. AnInterruptedExceptionwill be catched and ignored while setting the interrupt flag again.- Parameters:
milliseconds- Time in milliseconds to sleep
-
triggerSimpleEvent
Utility function to trigger a simple event handler. If the handler is currently null it gets silently ignored.- Parameters:
handler- Event handler to call or null
-