diff --git a/bin/Debug/UDPclient b/bin/Debug/UDPclient index 7e743b0..54a73b4 100755 Binary files a/bin/Debug/UDPclient and b/bin/Debug/UDPclient differ diff --git a/henglong.c b/henglong.c index 3016a79..b1c3b7a 100644 --- a/henglong.c +++ b/henglong.c @@ -28,13 +28,13 @@ int data2frame(int data) int values2data(int velocity, int direction, int ignation, int mg, int fire, int turretelev, int turret_left, int turret_right, int recoil) { int data = 0; - data = (mg & 1) | (ignation & 1) << 1 | (direction & 0b11110) << 2 | (fire & 1) << 7 | (turretelev & 1) << 8 | (turret_left & 1) << 9 | (turret_right & 1) << 10 | (recoil & 1) << 11 | (velocity & 0b11110) << 12; + data = (mg & 1) | (ignation & 1) << 1 | (direction & 0b11111) << 2 | (fire & 1) << 7 | (turretelev & 1) << 8 | (turret_left & 1) << 9 | (turret_right & 1) << 10 | (recoil & 1) << 11 | (velocity & 0b11111) << 12; return data; } void inithenglong(henglong_t* henglong) { - henglong->velocity = 0b10000; + henglong->velocity = 0b01111; henglong->direction = 0b01111; henglong->ignation = 0; henglong->mg = 0; @@ -65,28 +65,28 @@ int event2data(henglong_t* henglong, struct input_event event) } if(108==event.code){ if(event.value){ - henglong->velocity = 0b11111; + henglong->velocity = 0b11000; }else{ - henglong->velocity = 0b10000; + henglong->velocity = 0b01111; } } if(103==event.code){ if(event.value){ - henglong->velocity = 0b00000; + henglong->velocity = 0b00011; }else{ - henglong->velocity = 0b10000; + henglong->velocity = 0b01111; } } if(105==event.code){ if(event.value){ - henglong->direction = 0b00000; + henglong->direction = 0b00011; }else{ henglong->direction = 0b01111; } } if(106==event.code){ if(event.value){ - henglong->direction = 0b11111; + henglong->direction = 0b11100; }else{ henglong->direction = 0b01111; } diff --git a/obj/Debug/henglong.o b/obj/Debug/henglong.o index 729229a..e45a976 100644 Binary files a/obj/Debug/henglong.o and b/obj/Debug/henglong.o differ