my_upcamera.c
1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "my_upcamera.h"
#include "includes.h"
#include "hardware.h"
//u32 UpCodeV=0; //码值
//double UpCodeX=0; //X值
//double UpCodeY=0; //Y值
//double UpCodeP=0; //角度值
//u8 isShelfBe = 0; //是否存在货架
////void readCameraDataFromUart5TTL(void)
////{
//// u8 res[15];//相机协议
//// u8 i,j;
//// u8 check485=0;//相机校验和
//// u32 value485=0;
//// signed short x485=0;
//// signed short y485=0;
//// u16 phi485=0;
////// u16 t485=0;
//// u16 Code_p=0;
//// UART5_Receive_Data(res);
//// for(i=0;i<14;i++)
//// {
//// check485+=res[i];
//// }
//// if(check485==res[14]&&res[0]==0xAA&&res[1]==0x4D)
//// {
////// t485 =res[3];
//// value485=(res[4]<<0)+(res[5]<<8)+(res[6]<<16)+(res[7]<<24);
//// x485 =(res[8]<<0)+(res[9]<<8);
//// y485 =(res[10]<<0)+(res[11]<<8);
//// phi485 =(res[12]<<0)+(res[13]<<8);
////
//// Code_p=phi485+9000+dataCameraMountingAngle*100;
//// if(Code_p>36000)Code_p-=36000;
////
//// UpCodeV=value485;//
//// UpCodeX=x485*0.22;//
//// UpCodeY=y485*0.22;//相机方向位置改变,X,Y换向
//// UpCodeP=360.0-(double)Code_p/100.0f;
//// }
//// if(value485!=0)isShelfBe=1;else isShelfBe=0;
//// for(j=0;j<15;j++)res[j]=0;
////}