Laser Sensing Display for UI interfaces in the real world

Dependencies:   mbed

Fork of skinGames_forktest by Alvaro Cassinelli

Revision:
28:44b7b6e35548
Parent:
27:1ce994629ffc
Child:
29:2fc8c12822eb
--- a/main.cpp	Mon Jun 18 15:09:25 2012 +0000
+++ b/main.cpp	Tue Jun 19 11:22:46 2012 +0000
@@ -391,7 +391,24 @@
             // timerForRendering.attach(&lsr, &simpleLaserSensingRenderer::laserRenderThreadONEBLOBONLY, RENDER_INTERVAL);
         }
     }
-    else if (!strcmp(address[0], "spot_following")) {
+   
+   else if (!strcmp(address[0], "air_hockey")) {
+        int value=data[0];
+        if (value!=-1) { // otherwise do nothing, this is a reception error (there was no data)
+
+            timerForRendering.detach();
+            // blobconf.computeBoundingBox();
+            blobconf.clearConfig();
+
+            for (int i=0; i<value ; i++) blobconf.addOneRigidLoopAirHockey();
+
+            lsr.setConfigToRender(&blobconf);
+            timerForRendering.attach(&lsr, &simpleLaserSensingRenderer::laserRenderThread, RENDER_INTERVAL);
+            // timerForRendering.attach(&lsr, &simpleLaserSensingRenderer::laserRenderThreadONEBLOBONLY, RENDER_INTERVAL);
+        }
+    }
+   
+   else if (!strcmp(address[0], "spot_following")) {
         int value=data[0];
         if (value!=-1) { // otherwise do nothing, this is a reception error (there was no data)