Shinya Matsuyama / Mbed OS MF_FUJIKO_BASE

Dependencies:   libTCS34725

Revision:
1:db5fca88ffb4
Parent:
0:bed71d1853ef
Child:
3:c27e42a28010
--- a/main.cpp	Wed Jan 30 05:20:36 2019 +0000
+++ b/main.cpp	Sat Feb 02 08:18:02 2019 +0000
@@ -7,8 +7,8 @@
 #include "ColorUtil.h"
 
 // #define POSITION_011
-// #define POSITION_091
-#define POSITION_111
+#define POSITION_091
+// #define POSITION_111
 // #define POSITION_131
 
 
@@ -203,7 +203,8 @@
 
 
 Timeout lightTimer;
-#define LIGHT_ON_TIME    (3.0)
+#define LIGHT_TIME_BEFORE_ON    (3.0)
+#define LIGHT_TIME_WHILE_ON     (3.0)
 
 void lightTimerDone() {
     light = false;
@@ -211,7 +212,7 @@
 
 void lightTurnON() {
     light = true;
-    lightTimer.attach(&lightTimerDone, LIGHT_ON_TIME);
+    lightTimer.attach(&lightTimerDone, LIGHT_TIME_WHILE_ON);
 }
 
 
@@ -255,7 +256,7 @@
     }
     
     if ((courseID == COURSE_MIDDLE) && (colorID == COLOR_YELLOW)) {
-        lightTurnON();
+        lightTimer.attach(&lightTurnON, LIGHT_TIME_BEFORE_ON);
     }
 }