bzr branch
http://bzr.ed.am/elec/quadcopter
16
by Tim Marston
added (unfinished) rc-interface module to src; added arduino.mk |
1 |
// |
2 |
// config.h |
|
3 |
// |
|
4 |
// Configuration for rc-interface module. |
|
5 |
||
17
by Tim Marston
rc-interface: mostly completed it (untested, but rx and tx code should work) |
6 |
// ____________________________________________________________________________ |
7 |
// general |
|
8 |
||
9 |
// 0 <= channel value <= this constant |
|
18
by Tim Marston
completed (hopefully) the RC interface software |
10 |
#define MAX_CHANNEL_VALUE 1000 |
17
by Tim Marston
rc-interface: mostly completed it (untested, but rx and tx code should work) |
11 |
|
12 |
// pulse width when channel value is 0 (in microseconds) |
|
13 |
//#define MIN_PULSE_WIDTH 1150UL |
|
14 |
#define MIN_PULSE_WIDTH 1000UL |
|
15 |
||
16 |
// pulse width when channel value is MAX_CHANNEL_VALUE (in microseconds) |
|
17 |
//#define MAX_PULSE_WIDTH 1750UL |
|
18 |
#define MAX_PULSE_WIDTH 2000UL |
|
16
by Tim Marston
added (unfinished) rc-interface module to src; added arduino.mk |
19 |
|
18
by Tim Marston
completed (hopefully) the RC interface software |
20 |
// LED pin |
21 |
#define LED_PIN 13 |
|
22 |
||
16
by Tim Marston
added (unfinished) rc-interface module to src; added arduino.mk |
23 |
// ____________________________________________________________________________ |
24 |
// receiver |
|
25 |
||
26 |
// number of channels |
|
27 |
#define NUM_CHANNELS 8 |
|
28 |
||
29 |
// comma-separated order that channels are received in (channels are numbered |
|
30 |
// from 1 to NUM_CHANNELS) |
|
31 |
#define CHANNEL_ORDER 1, 3, 2, 4, 5, 6, 7, 8 |
|
32 |
||
33 |
// minimum frame gap time (in ms), used to check that the frame gap is where we |
|
34 |
// expect it to be and that we have read the channels properly |
|
35 |
#define MIN_FRAME_GAP_WIDTH ( 4000UL + MIN_PULSE_WIDTH ) |
|
36 |
||
37 |
// ____________________________________________________________________________ |
|
38 |
// esc controller |
|
39 |
||
17
by Tim Marston
rc-interface: mostly completed it (untested, but rx and tx code should work) |
40 |
// number of motors |
41 |
#define NUM_MOTORS 4 |
|
42 |
||
43 |
// pin number of first channel |
|
44 |
#define FIRST_PIN 4 |
|
45 |
||
46 |
// interval between rising edges of successinve channels in microseconds |
|
47 |
#define CHANNEL_INTERVAL ( MAX_PULSE_WIDTH + 500UL ) |
|
48 |
||
49 |
// duration of a whole frame (including the pulse) in microseconds |
|
50 |
#define FRAME_DURATION 20000UL |
|
51 |
||
16
by Tim Marston
added (unfinished) rc-interface module to src; added arduino.mk |
52 |
// ____________________________________________________________________________ |
53 |
// |