vt100: include pgmspace.h as we use PROGMEM macro
[aversive.git] / projects / microb2010 / mainboard / display.py
index 5700edc..ff5bb02 100644 (file)
@@ -169,10 +169,12 @@ def init_waypoints():
                 continue
 
             # balls
-            if (i & 1) == 0 and j > 3:
+            if (i & 1) == 0 and j > 3 and \
+                    (not (i == 0 and j == WAYPOINTS_NBY-1)) and \
+                    (not (i == WAYPOINTS_NBX-1 and j == WAYPOINTS_NBY-1)):
                 waypoints[i][j] = TYPE_BALL
                 continue
-            if (i == 0 or i == WAYPOINTS_NBX-1) and j > 2:
+            if (i == 0 or i == WAYPOINTS_NBX-1) and j > 2 and j < 7:
                 waypoints[i][j] = TYPE_BALL
                 continue
 
@@ -303,7 +305,7 @@ def set_robot():
     lspickle.axis = axis
     lspickle.size = (20, ROBOT_WIDTH, 5)
     if robot_lspickle_autoharvest:
-        lspickle.color = (1, 0, 0)
+        lspickle.color = (0.2, 0.2, 1)
     else:
         lspickle.color = (0.4, 0.4, 0.4)
 
@@ -313,7 +315,7 @@ def set_robot():
     rspickle.axis = axis
     rspickle.size = (20, ROBOT_WIDTH, 5)
     if robot_rspickle_autoharvest:
-        rspickle.color = (1, 0, 0)
+        rspickle.color = (0.2, 0.2, 1)
     else:
         rspickle.color = (0.4, 0.4, 0.4)
 
@@ -378,10 +380,10 @@ while True:
             if not m:
                 m = re.match("cobboard=%s,%s"%(INT,INT), l)
                 if m:
-                    #print "cobboard: %x,%x"%(int(m.groups()[0]),int(m.groups()[1]))
+                    print "cobboard: %x,%x"%(int(m.groups()[0]),int(m.groups()[1]))
                     side = int(m.groups()[0])
                     flags = int(m.groups()[1])
-                    if side == 0:
+                    if (side == 0 and color == YELLOW) or (side == 1 and color == BLUE):
                         robot_lspickle_deployed = ((flags & 1) * 2)
                         robot_lspickle_autoharvest = ((flags & 2) != 0)
                     else:
@@ -416,6 +418,8 @@ while True:
                 fw.write("l")
             elif k == "r":
                 fw.write("r")
+            elif k == "b":
+                fw.write("b")
             elif k == "c":
                 robot_trail_list = []
             elif k == "x":