package com.ociweb.grove;


import static com.ociweb.iot.grove.GroveTwig.*;

import com.ociweb.iot.maker.*;
import static com.ociweb.iot.maker.Port.*;

public class TouchSensor implements FogApp
{
    ///////////////////////
    //Connection constants 
    ///////////////////////


    @Override
    public void declareConnections(Hardware c) {
        ////////////////////////////
        //Connection specifications
        ///////////////////////////

        
    }


    @Override
    public void declareBehavior(FogRuntime runtime) {
        //////////////////////////////
        //Specify the desired behavior
        //////////////////////////////

    }
          
}

@@ -20,17 +20,16 @@
 grove;%0A%0A
-%0A
 import s
@@ -68,17 +68,16 @@
 Twig.*;%0A
-%0A
 import c
@@ -192,283 +192,252 @@
 p%0A%7B%0A
-    ///////////////////////%0A    //Connection constants %0A    ///////////////////////%0A%0A%0A    @Override%0A    public void declareConnections(Hardware c) %7B%0A        ////////////////////////////%0A        //Connection specifications%0A        ///////////////////////////%0A%0A        
+%09private static final Port TOUCH_SENSOR_PORT = D4;%0A%09private static final Port LED_PORT = D2;%0A%09%0A    @Override%0A    public void declareConnections(Hardware c) %7B%0A    %09c.connect(TouchSensor, TOUCH_SENSOR_PORT);%0A    %09c.connect(LED, LED_PORT);
 %0A    %7D%0A%0A
 %0A   
@@ -432,17 +432,16 @@
 %0A    %7D%0A%0A
-%0A
     @Ove
@@ -508,137 +508,343 @@
     
-    //////////////////////////////%0A        //Specify the desired behavior%0A        //////////////////////////////%0A%0A    %7D%0A
+%09final FogCommandChannel channel1 = runtime.newCommandChannel(DYNAMIC_MESSAGING);%0A        runtime.addDigitalListener((port, connection, time, value)-%3E%7B %0A            channel1.setValueAndBlock(LED_PORT, value == 1, 500);                                                                            //delays a future action%0A  
       
+%7D);%0A
     
+%7D
 %0A%7D%0A

Update TouchSensor.java