aigamo get data

Dependents:   agz_base_ver2 agz_base_ver2 get_GPS_data_ver1 aigamozu_program_ver2 ... more

Committer:
kityann
Date:
Mon Apr 20 10:36:59 2015 +0000
Revision:
3:14e469b0c33e
Parent:
0:54e62ef6d287
a

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kityann 0:54e62ef6d287 1 #include "agz_common.h"
kityann 0:54e62ef6d287 2 #include "XBee.h"
kityann 0:54e62ef6d287 3
kityann 0:54e62ef6d287 4
kityann 0:54e62ef6d287 5
kityann 0:54e62ef6d287 6 /*XBee Address List
kityann 0:54e62ef6d287 7 * this is xbee addresses.
kityann 0:54e62ef6d287 8 * AGZ_ROBOT Address is Agz_XBee_Remote_Address[AGZ_FROM_ROBOT] ~ Agz_XBee_Remote_Address[AGZ_TO_ROBOT]
kityann 0:54e62ef6d287 9 * Base and JOY-STICK is same.
kityann 0:54e62ef6d287 10 */
kityann 0:54e62ef6d287 11
kityann 0:54e62ef6d287 12 XBeeAddress64 Agz_XBee_Remote_Address[AGZ_NUM_ROBOTS] = {XBeeAddress64(0x0013A200, 0x409EAEF3)//R1
kityann 0:54e62ef6d287 13 ,XBeeAddress64(0x0013A200, 0x40993719)//R2
kityann 0:54e62ef6d287 14 ,XBeeAddress64(0x0013A200, 0x409EAEEB)//R3
kityann 0:54e62ef6d287 15 ,XBeeAddress64(0x0013A200, 0x409EAF0E)};//R4
kityann 0:54e62ef6d287 16 /*
kityann 0:54e62ef6d287 17 {XBeeAddress64(0x0013A200, 0x409EAF01)
kityann 0:54e62ef6d287 18 ,XBeeAddress64(0x0013A200, 0x409EAF01)
kityann 0:54e62ef6d287 19 ,XBeeAddress64(0x0013A200, 0x409EAF01)
kityann 0:54e62ef6d287 20 ,XBeeAddress64(0x0013A200, 0x409EAF01)};
kityann 0:54e62ef6d287 21 */
kityann 0:54e62ef6d287 22
kityann 0:54e62ef6d287 23
kityann 0:54e62ef6d287 24 /*----------------------------------------------
kityann 0:54e62ef6d287 25 member function of "AGZ_ROBOT"
kityann 0:54e62ef6d287 26 ------------------------------------------------*/
kityann 0:54e62ef6d287 27 //set function
kityann 0:54e62ef6d287 28 AGZ_ROBOT::AGZ_ROBOT(){
kityann 0:54e62ef6d287 29 state = 0xFF;
kityann 0:54e62ef6d287 30 }
kityann 0:54e62ef6d287 31
kityann 0:54e62ef6d287 32 void AGZ_ROBOT::set_state(uint8_t s){
kityann 0:54e62ef6d287 33 state = s;
kityann 0:54e62ef6d287 34 }
kityann 0:54e62ef6d287 35
kityann 0:54e62ef6d287 36 void AGZ_ROBOT::set_LatitudeH(uint8_t *data){
kityann 0:54e62ef6d287 37 for(int i = 0;i < 3;i++)
kityann 0:54e62ef6d287 38 LatitudeH.value_ch[i] = data[i];
kityann 0:54e62ef6d287 39 }
kityann 0:54e62ef6d287 40
kityann 0:54e62ef6d287 41 void AGZ_ROBOT::set_LatitudeL(uint8_t *data){
kityann 0:54e62ef6d287 42 for(int i = 0;i < 6;i++)
kityann 0:54e62ef6d287 43 LatitudeL.value_ch[i] = data[i];
kityann 0:54e62ef6d287 44 }
kityann 0:54e62ef6d287 45
kityann 0:54e62ef6d287 46 void AGZ_ROBOT::set_LongitudeH(uint8_t *data){
kityann 0:54e62ef6d287 47 for(int i = 0;i < 3;i++)
kityann 0:54e62ef6d287 48 LongitudeH.value_ch[i] = data[i];
kityann 0:54e62ef6d287 49 }
kityann 0:54e62ef6d287 50
kityann 0:54e62ef6d287 51 void AGZ_ROBOT::set_LongitudeL(uint8_t *data){
kityann 0:54e62ef6d287 52 for(int i = 0;i < 6;i++)
kityann 0:54e62ef6d287 53 LongitudeL.value_ch[i] = data[i];
kityann 0:54e62ef6d287 54 }
kityann 0:54e62ef6d287 55
kityann 0:54e62ef6d287 56
kityann 0:54e62ef6d287 57 //get function
kityann 0:54e62ef6d287 58 long AGZ_ROBOT::get_LatitudeH(){
kityann 0:54e62ef6d287 59 return LatitudeH.value_long;
kityann 0:54e62ef6d287 60 }
kityann 0:54e62ef6d287 61
kityann 0:54e62ef6d287 62 long AGZ_ROBOT::get_LatitudeL(){
kityann 0:54e62ef6d287 63 return LatitudeL.value_long;
kityann 0:54e62ef6d287 64 }
kityann 0:54e62ef6d287 65
kityann 0:54e62ef6d287 66 long AGZ_ROBOT::get_LongitudeH(){
kityann 0:54e62ef6d287 67 return LongitudeH.value_long;
kityann 0:54e62ef6d287 68 }
kityann 0:54e62ef6d287 69
kityann 0:54e62ef6d287 70 long AGZ_ROBOT::get_LongitudeL(){
kityann 0:54e62ef6d287 71 return LongitudeL.value_long;
kityann 0:54e62ef6d287 72 }
kityann 0:54e62ef6d287 73 uint8_t AGZ_ROBOT::get_state(){
kityann 0:54e62ef6d287 74 return state;
kityann 3:14e469b0c33e 75 }
kityann 3:14e469b0c33e 76
kityann 3:14e469b0c33e 77
kityann 3:14e469b0c33e 78 void AGZ_ROBOT::set_LatitudeKH(uint8_t *data){
kityann 3:14e469b0c33e 79 for(int i = 0;i < 3;i++)
kityann 3:14e469b0c33e 80 LatitudeKH.value_ch[i] = data[i];
kityann 3:14e469b0c33e 81 }
kityann 3:14e469b0c33e 82
kityann 3:14e469b0c33e 83 void AGZ_ROBOT::set_LatitudeKL(uint8_t *data){
kityann 3:14e469b0c33e 84 for(int i = 0;i < 6;i++)
kityann 3:14e469b0c33e 85 LatitudeKL.value_ch[i] = data[i];
kityann 3:14e469b0c33e 86 }
kityann 3:14e469b0c33e 87
kityann 3:14e469b0c33e 88 void AGZ_ROBOT::set_LongitudeKH(uint8_t *data){
kityann 3:14e469b0c33e 89 for(int i = 0;i < 3;i++)
kityann 3:14e469b0c33e 90 LongitudeKH.value_ch[i] = data[i];
kityann 3:14e469b0c33e 91 }
kityann 3:14e469b0c33e 92
kityann 3:14e469b0c33e 93 void AGZ_ROBOT::set_LongitudeKL(uint8_t *data){
kityann 3:14e469b0c33e 94 for(int i = 0;i < 6;i++)
kityann 3:14e469b0c33e 95 LongitudeKL.value_ch[i] = data[i];
kityann 3:14e469b0c33e 96 }
kityann 3:14e469b0c33e 97
kityann 3:14e469b0c33e 98
kityann 3:14e469b0c33e 99 //get function
kityann 3:14e469b0c33e 100 long AGZ_ROBOT::get_LatitudeKH(){
kityann 3:14e469b0c33e 101 return LatitudeKH.value_long;
kityann 3:14e469b0c33e 102 }
kityann 3:14e469b0c33e 103
kityann 3:14e469b0c33e 104 long AGZ_ROBOT::get_LatitudeKL(){
kityann 3:14e469b0c33e 105 return LatitudeKL.value_long;
kityann 3:14e469b0c33e 106 }
kityann 3:14e469b0c33e 107
kityann 3:14e469b0c33e 108 long AGZ_ROBOT::get_LongitudeKH(){
kityann 3:14e469b0c33e 109 return LongitudeKH.value_long;
kityann 3:14e469b0c33e 110 }
kityann 3:14e469b0c33e 111
kityann 3:14e469b0c33e 112 long AGZ_ROBOT::get_LongitudeKL(){
kityann 3:14e469b0c33e 113 return LongitudeKL.value_long;
kityann 3:14e469b0c33e 114 }