- 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
public abstract class Component extends Object
-
-
Constructor Summary
Constructors Constructor Description Component()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
sleep(long milliseconds)
Utility function to sleep for the specified amount of milliseconds.protected void
triggerSimpleEvent(SimpleEventHandler handler)
Utility function to trigger a simple event handler.
-
-
-
Field Detail
-
logger
protected final Logger logger
Logger instance
-
-
Method Detail
-
sleep
protected void sleep(long milliseconds)
Utility function to sleep for the specified amount of milliseconds. AnInterruptedException
will be catched and ignored while setting the interrupt flag again.- Parameters:
milliseconds
- Time in milliseconds to sleep
-
triggerSimpleEvent
protected void triggerSimpleEvent(SimpleEventHandler handler)
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
-
-