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