var bt_y[20];\r
var bt_x[20];\r
var out_buff[3];\r
+var msg_len;\r
+\r
+func send_msg()\r
+ var idx;\r
+ idx := 0;\r
+ \r
+ repeat\r
+ serout(msg_buff[idx]);\r
+ idx++;\r
+ until(idx==msg_len)\r
+\r
+endfunc\r
\r
func act_lift_calib()\r
out_buff[0]:=MSG_START;\r
y := touch_Get(TOUCH_GETY);\r
if((y > bt_y[BT_LIFT_CALIB])&&(y<bt_y[BT_PUSHER_IN]))\r
lift_calib_bt(UP);\r
+ act_lift_calib();\r
endif \r
if((y > bt_y[BT_PUSHER_IN])&&(y<bt_y[BT_PUSHER_OUT]))\r
pusher_in_bt(UP);\r
+ act_pusher_in();\r
endif \r
if((y > bt_y[BT_PUSHER_OUT])&&(y<bt_y[BT_LIFT_UP]))\r
pusher_out_bt(UP);\r
+ act_pusher_out();\r
endif \r
if((y > bt_y[BT_LIFT_UP])&&(y<bt_y[BT_LIFT_DOWN]))\r
lift_up_bt(UP);\r
+ act_lift_up();\r
endif \r
if((y > bt_y[BT_LIFT_DOWN])&&(y<bt_y[BT_CMU_INIT]))\r
lift_down_bt(UP);\r
+ act_lift_down();\r
endif \r
if((y > bt_y[BT_CMU_INIT])&&(y<bt_y[BT_START]))\r
cmu_init_bt(UP);\r
+ act_cmu_init();\r
endif \r
if((y > bt_y[BT_START])&&(y<bt_y[BT_COLOR]))\r
start_bt(UP);\r
+ act_start();\r
endif \r
endif\r
endfunc\r