/elec/quadcopter

To get this branch, use:
bzr branch http://bzr.ed.am/elec/quadcopter

« back to all changes in this revision

Viewing changes to src/rc-interface/config.h

  • Committer: Tim Marston
  • Date: 2014-01-15 22:18:56 UTC
  • Revision ID: tim@ed.am-20140115221856-lcqttlborwi7ot7k
rc-interface: mostly completed it (untested, but rx and tx code should work)

Show diffs side-by-side

added added

removed removed

3
3
//
4
4
// Configuration for rc-interface module.
5
5
 
 
6
// ____________________________________________________________________________
 
7
//                                                                      general
 
8
 
 
9
// 0 <= channel value <= this constant
 
10
#define MAX_CHANNEL_VALUE 1000UL
 
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
6
19
 
7
20
// ____________________________________________________________________________
8
21
//                                                                     receiver
14
27
// from 1 to NUM_CHANNELS)
15
28
#define CHANNEL_ORDER 1, 3, 2, 4, 5, 6, 7, 8
16
29
 
17
 
// minimum pulse width (in ms), used to weed out crappy signals
18
 
#define MIN_PULSE_WIDTH 1000UL
19
 
 
20
 
// maximum pulse width (in ms), used to weed out crappy signals
21
 
#define MAX_PULSE_WIDTH 2000UL
22
 
 
23
30
// minimum frame gap time (in ms), used to check that the frame gap is where we
24
31
// expect it to be and that we have read the channels properly
25
32
#define MIN_FRAME_GAP_WIDTH ( 4000UL + MIN_PULSE_WIDTH )
27
34
// ____________________________________________________________________________
28
35
//                                                               esc controller
29
36
 
 
37
// number of motors
 
38
#define NUM_MOTORS 4
 
39
 
 
40
// pin number of first channel
 
41
#define FIRST_PIN 4
 
42
 
 
43
// interval between rising edges of successinve channels in microseconds
 
44
#define CHANNEL_INTERVAL ( MAX_PULSE_WIDTH + 500UL )
 
45
 
 
46
// duration of a whole frame (including the pulse) in microseconds
 
47
#define FRAME_DURATION 20000UL
 
48
 
30
49
// ____________________________________________________________________________
31
50
//