Line 41... |
Line 41... |
41 |
signed int ble; |
41 |
signed int ble; |
42 |
|
42 |
|
43 |
Motor = analogRead(A0); |
43 |
Motor = analogRead(A0); |
44 |
Rudder = analogRead(A1); |
44 |
Rudder = analogRead(A1); |
45 |
|
45 |
|
- |
|
46 |
//!!! |
- |
|
47 |
Serial.print(Motor, DEC); |
- |
|
48 |
Serial.print(" * "); |
- |
|
49 |
Serial.println(Rudder, DEC); |
- |
|
50 |
|
46 |
Motor = MotorOffset - Motor; |
51 |
Motor = MotorOffset - Motor; |
- |
|
52 |
Rudder=1023-Rudder; |
47 |
Rudder = 512 - ((RudderOffset - Rudder)<<2); |
53 |
Rudder = 512 - ((RudderOffset - Rudder)<<2); |
48 |
Motor>>=2; |
54 |
Motor>>=2; |
49 |
Rudder>>=2; |
55 |
Rudder>>=2; |
50 |
if (Motor>200) Motor=0; |
56 |
if (Motor>200) Motor=0; // Odstranit pro programovani regulatoru |
51 |
if (Rudder>250) Rudder=0; |
57 |
if (Rudder>250) Rudder=0; |
- |
|
58 |
//if (Rudder<71) Rudder=71; |
52 |
|
59 |
|
53 |
Check=Motor+Rudder; |
60 |
Check=Motor+Rudder; |
54 |
|
61 |
|
55 |
_tx_buffer[0]=(unsigned char)Motor; |
62 |
_tx_buffer[0]=(unsigned char)Motor; |
56 |
_tx_buffer[1]=(unsigned char)Rudder; |
63 |
_tx_buffer[1]=(unsigned char)Rudder; |