?? find_color_shape.asm
字號:
//=============================================================
//名稱:Find_Color_Shape.asm
//來源:chengjie\ Email:chengjie@sunnorth.com.cn
//描述:獲得顏色和外形并用語音播報
//日期:2003.11.5
//==============================================================
.include hardware.inc
.include eagle3.inc
.external _VR_PrevResult
.external _VR_PrevResult_Color
.external _VR_PrevResult_Shape
.external _VR_PrevResult_CenterX;
.external _VR_PrevResult_CenterY;
.external _VR_PrevResult_AreaH;
.external _VR_PrevResult_AreaL;
.code
//===================================================
//函數:Find_Color_Shape
//語法:調用
//描述:獲得物體的顏色和外形并播報
//參數:無
//返回:無
//===================================================
.public _Find_Color_Shape
_Find_Color_Shape: .proc
call F_Find_Color_Shape
retf
.endp
.public F_Find_Color_Shape;
F_Find_Color_Shape:
call F_NormalOperMode // 允許地址75選用,地址為75+00選擇手動設置
call F_OperMode
call F_ShapeAnaly // 允許地址70選用
call F_Clear70E8
call F_FeatureEngine // 允許地址74特征寄存器選用
L_Analysis_Again:
call F_HighAddr74
r1 = 0x05 // 選擇辨別藍色、紅色、綠色、黃色
[R_AddrBuffer] = r1
r1 = 0x08
[R_WriteDataBuffer] = r1
call F_WriteOper
r1 = 0
[R_DelayTime] = r1
L_WaitFor:
r1 = [R_DelayTime]
cmp r1 ,0x42
jbe L_WaitFor
call F_GetObjNum // 讀目標數目
r1 = [R_SeekFlag]
r1 &= 0x80
jnz L_Analysis_Again // 目標數目>8
r1 = [R_SeekFlag];
r1 &= 0xfe;
[R_SeekFlag] = r1;
r1 = 0x00; // 清變量
[R_PreAreaH] = r1;
[R_PreColor] = r1;
[R_PreShape] = r1;
[R_AreaH] = r1;
[R_AreaL] = r1;
[R_Color] = r1;
[R_Shape] = r1;
[R_CenterX] = r1;
[R_CenterY] = r1;
call F_GetObjDataOne; // 獲得一個物體的數據
r1 = [R_Color]; // 存放變量中
[_VR_PrevResult_Color] = r1;
r1 = [R_Shape];
[_VR_PrevResult_Shape] = r1;
r1 = [R_CenterX]
[_VR_PrevResult_CenterX] = r1
r1 = [R_CenterY]
[_VR_PrevResult_CenterY] = r1
r1 = [R_AreaH]
[_VR_PrevResult_AreaH] = r1
r1 = [R_AreaL]
[_VR_PrevResult_AreaL] = r1
retf;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -