Rev 1452 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1452 | Rev 1568 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /*############################################################################ |
1 | /*############################################################################ |
2 | ############################################################################*/ |
2 | ############################################################################*/ |
Line 3... | Line 3... | ||
3 | 3 | ||
- | 4 | #include "main.h" |
|
Line 4... | Line 5... | ||
4 | #include "main.h" |
5 | #include "heli.h" |
5 | 6 | ||
6 | volatile unsigned char twi_state = 0; |
7 | volatile unsigned char twi_state = 0; |
7 | unsigned char motor = 0; |
8 | unsigned char motor = 0; |
Line 161... | Line 162... | ||
161 | I2CTimeout = 10; |
162 | I2CTimeout = 10; |
162 | twi_state = 0; |
163 | twi_state = 0; |
163 | break; |
164 | break; |
Line 164... | Line 165... | ||
164 | 165 | ||
165 | case 0: |
- | |
166 | i2c_write_byte(0x82); // servo board |
- | |
167 | twi_state = 100; |
- | |
168 | break; |
- | |
169 | case 100: // servo 1 |
- | |
170 | i2c_write_byte(servoValues[0]); |
- | |
171 | break; |
- | |
172 | case 101: // servo 2 |
- | |
173 | i2c_write_byte(servoValues[1]); |
- | |
174 | break; |
- | |
175 | case 102: // servo 3 |
- | |
176 | i2c_write_byte(servoValues[2]); |
- | |
177 | break; |
- | |
178 | case 103: // servo 4 |
- | |
179 | i2c_write_byte(servoValues[3]); |
- | |
180 | break; |
- | |
181 | case 104: // servo 5 |
- | |
182 | i2c_write_byte(servoValues[4]); |
- | |
183 | break; |
- | |
184 | case 105: // servo 6 |
- | |
185 | i2c_write_byte(servoValues[5]); |
- | |
186 | break; |
- | |
187 | case 106: |
- | |
188 | i2c_write_byte(calc_crc(&servoValues, 6)); |
- | |
189 | break; |
- | |
190 | case 107: |
166 | case 0: |
191 | i2c_stop(); |
167 | i2c_stop(); |
192 | I2CTimeout = 10; |
168 | I2CTimeout = 10; |
193 | twi_state = 0; |
169 | twi_state = 0; |
194 | break; |
170 | break; |