Laser Sensing Display for UI interfaces in the real world

Dependencies:   mbed

Fork of skinGames_forktest by Alvaro Cassinelli

Revision:
37:fa6b1f15819f
Parent:
36:233b12d0b1f0
Child:
40:3ba2b0ea9f33
--- a/main.cpp	Wed Mar 13 11:38:48 2013 +0000
+++ b/main.cpp	Wed Mar 13 12:29:37 2013 +0000
@@ -201,8 +201,8 @@
             if (stateswitch) pc.printf("Setting AUTO threshold mode\n"); else pc.printf("Setting FIXED threshold mode\n"); 
             for (int i=0; i< blobconf.numBlobs; i++) blobconf.blobArray[i]->displaySensingBuffer.setThresholdMode((stateswitch? 1 : 0));
         }
-        //(2) in case the threshold mode is set to fixed, check the current pot value and update the threshold when pressing second switch:
-       if ((blobconf.blobArray[0]->displaySensingBuffer.modeThreshold==FIXED)&&(IO.switchTwoCheck(stateswitch))) { 
+        //(2) in case the the second switch was pressed, check the current pot value and update the fixed threshold (regardless of the threshold mode)
+       if (IO.switchTwoCheck(stateswitch)) { 
            IO.updatePotValue(); 
            for (int i=0; i< blobconf.numBlobs; i++) blobconf.blobArray[i]->displaySensingBuffer.setFixedThreshold(IO.potValue);
            pc.printf("Got :%d\n", IO.potValue);