Search in sources :

Example 6 with FogCommandChannel

use of com.ociweb.iot.maker.FogCommandChannel in project FogLight-Examples by oci-pronghorn.

the class IoTApp method declareBehavior.

@Override
public void declareBehavior(FogRuntime runtime) {
    final FogCommandChannel ledChannel = runtime.newCommandChannel(GreenCommandChannel.DYNAMIC_MESSAGING | FogRuntime.PIN_WRITER);
    runtime.addDigitalListener((connection, time, durationMillis, value) -> {
        ledChannel.setValue(LED_PORT, value);
    });
}
Also used : FogCommandChannel(com.ociweb.iot.maker.FogCommandChannel)

Aggregations

FogCommandChannel (com.ociweb.iot.maker.FogCommandChannel)6 GreenCommandChannel (com.ociweb.gl.api.GreenCommandChannel)2 Grove_LCD_RGB (com.ociweb.iot.grove.lcd_rgb.Grove_LCD_RGB)2 LED (com.ociweb.iot.grove.simple_digital.SimpleDigitalTwig.LED)2 FogApp (com.ociweb.iot.maker.FogApp)2 FogRuntime (com.ociweb.iot.maker.FogRuntime)2 Hardware (com.ociweb.iot.maker.Hardware)2 Port (com.ociweb.iot.maker.Port)2 D3 (com.ociweb.iot.maker.Port.D3)2 D5 (com.ociweb.iot.maker.Port.D5)2 D6 (com.ociweb.iot.maker.Port.D6)2 NetGraphBuilder (com.ociweb.pronghorn.network.NetGraphBuilder)2 LocalDateTime (java.time.LocalDateTime)2