velocity and direction highest value 0b11110 corrected

This commit is contained in:
Stefan Helmert 2014-01-07 05:25:14 +01:00
parent dc4d072d3e
commit 98c602a12f
7 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,5 @@
# depslib dependency file v1.0
1389037649 source:/home/stefan/Proj/UDPclient/main.c
1389064539 source:/home/stefan/Proj/UDPclient/main.c
<pthread.h>
<stdio.h>
<stdlib.h>

Binary file not shown.

View File

@ -1,5 +1,5 @@
INPUTDEV /dev/input/event2
FRAME_US 100000
SERVER 127.0.0.1:32000
SERVER 10.8.191.194:32000
TIMEOUT 250
CLINBR 0

View File

@ -28,7 +28,7 @@ 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 & 0b11111) << 2 | (fire & 1) << 7 | (turretelev & 1) << 8 | (turret_left & 1) << 9 | (turret_right & 1) << 10 | (recoil & 1) << 11 | (velocity & 0b11111) << 12;
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;
return data;
}

2
main.c
View File

@ -91,6 +91,8 @@ void *refl_thread_fcn(void* arg)
refl_thread_args_t* refl_thread_args_ptr;
uint8_t clinbr, clisel;
unsigned char servoff;
printf("pthread refl started\n");
refl_thread_args_ptr = (refl_thread_args_t*) arg;

Binary file not shown.

Binary file not shown.