Laser Sensing Display for UI interfaces in the real world

Dependencies:   mbed

Fork of skinGames_forktest by Alvaro Cassinelli

Revision:
24:4e52031a495b
Parent:
23:bf666fcc61bc
--- a/hardwareIO/hardwareIO.cpp	Wed Jun 13 10:09:41 2012 +0000
+++ b/hardwareIO/hardwareIO.cpp	Mon Jun 18 08:00:57 2012 +0000
@@ -100,23 +100,29 @@
 }
 
 void HardwareIO::showLimitsMirrors(int times) {
-      unsigned short pointsPerLine=100;
-      
-     for (int repeat=0; repeat<times; repeat++) {
-      
+      unsigned short pointsPerLine=150;
       int shiftX = (MAX_AD_MIRRORS - MIN_AD_MIRRORS) / pointsPerLine;
       int shiftY = (MAX_AD_MIRRORS - MIN_AD_MIRRORS) / pointsPerLine;
+   
+      Laser_Green=1;
+   
+     //for (int repeat=0; repeat<times; repeat++) {
+     
+     Timer t;
+     t.start();
+     while(t.read_ms()<times*1000) {
        
       writeOutX(MIN_AD_MIRRORS);writeOutY(MIN_AD_MIRRORS);
+   
       for(int j=0; j<pointsPerLine; j++){   
-      wait_us(200);//delay between each points
+       wait_us(200);//delay between each points
        writeOutY(j*shiftY + MIN_AD_MIRRORS);
        }
       
       writeOutX(MIN_AD_MIRRORS);writeOutY(MAX_AD_MIRRORS);
       for(int j=0; j<pointsPerLine; j++) {
          wait_us(200);//delay between each points
-         writeOutX(j*shiftX + MAX_AD_MIRRORS);
+         writeOutX(j*shiftX + MIN_AD_MIRRORS);
          }
       
       writeOutX(MAX_AD_MIRRORS);writeOutY(MAX_AD_MIRRORS);
@@ -132,6 +138,8 @@
          }
       
       }
+      t.stop();
+      Laser_Green=0;
 }
 
 void HardwareIO::scan_serial(unsigned short pointsPerLine){