Rev 210 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 210 | Rev 221 | ||
---|---|---|---|
Line 19... | Line 19... | ||
19 | 19 | ||
Line 20... | Line 20... | ||
20 | 20 | ||
- | 21 | private int i; |
|
- | 22 | ||
- | 23 | public int motor_val(int id) { return analog[12+id]; } |
|
- | 24 | public int nick_int() { return analog[1]; } |
|
- | 25 | public int roll_int() { return analog[2]; } |
|
Line 21... | Line 26... | ||
21 | private int i; |
26 | public int accnick() { return analog[3]; } |
22 | 27 | public int accroll() { return analog[4]; } |
|
23 | public int motor_val(int id) { return analog[12+id]; } |
28 | |
Line 38... | Line 43... | ||
38 | return; |
43 | return; |
Line 39... | Line 44... | ||
39 | 44 | ||
40 | if (version.compare(0,60)==version.VERSION_PREVIOUS) |
45 | if (version.compare(0,60)==version.VERSION_PREVIOUS) |
41 | { |
46 | { |
- | 47 | for (i=0;i<16;i++) |
|
42 | for (i=0;i<16;i++) |
48 | { |
- | 49 | analog[i]=(int)((in_arr[1+i*2]<<8) | in_arr[2+i*2]); |
|
- | 50 | if ((analog[i]&(2<<14))!=0) |
|
- | 51 | analog[i]=-(analog[i]&(0xFFFF-1))^(0xFFFF-1); |
|
43 | analog[i]=(in_arr[1+i*2]<<8) | in_arr[2+i*2]; |
52 | } |
44 | } |
53 | } |
45 | else |
54 | else |
46 | { |
55 | { |
- | 56 | for (i=0;i<16;i++) |
|
47 | for (i=0;i<16;i++) |
57 | { |
- | 58 | analog[i]=(int)((in_arr[17+i*2]<<8) | in_arr[18+i*2]); |
|
- | 59 | if ((analog[i]&(2<<14))!=0) |
|
- | 60 | analog[i]=-(analog[i]&(0xFFFF-1))^(0xFFFF-1); |
|
48 | analog[i]=(in_arr[17+i*2]<<8) | in_arr[18+i*2]; |
61 | } |
Line 49... | Line 62... | ||
49 | } |
62 | } |