/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 test/receiver/pulse-width-x8/main.ino

  • Committer: Tim Marston
  • Date: 2013-11-21 00:05:58 UTC
  • Revision ID: tim@ed.am-20131121000558-06xtcb4fue72td7q
updated 8-channel pulse width reading test program's comments

Show diffs side-by-side

added added

removed removed

11
11
// available, reading the analogue outputs is certainly more portable.  So, we
12
12
// are multiplexing the separate channels to two streams of pulses, like this:
13
13
//
14
 
//     ch.1  ch.3  ch.5  ch.7  ch.2  ch.4  ch.6  ch.8
15
 
//       |     |     |     |     |     |     |     |
16
 
//       ▼     ▼     ▼     ▼     ▼     ▼     ▼     ▼
17
 
//       ¯     ¯     ¯     ¯     ¯     ¯     ¯     ¯
18
 
//       |     |     |     |     |     |     |     |
19
 
//       '-----+-----+-----+     +-----+-----+-----'
20
 
//                         |     |
21
 
//    ____________________ | ___ | _____________________
22
 
//                         |     |
23
 
//         (int. 0) pin 2  o     o  pin 3 (int. 1)
 
14
//                  ch1  ch3  ch5  ch7  ch2  ch4  ch6  ch8
 
15
//                   |    |    |    |    |    |    |    |
 
16
//                   ▼    ▼    ▼    ▼    ▼    ▼    ▼    ▼
 
17
//                   ¯    ¯    ¯    ¯    ¯    ¯    ¯    ¯
 
18
//            ___    |    |    |    |    |    |    |    |     ___
 
19
//    GND ---|___|---+----+----+----+    +----+----+----+----|___|--- GND
 
20
//             R                    |    |                     R
 
21
//             ____________________ | __ | _____________________
 
22
//                                  |    |
 
23
//                  (int. 0) pin 2  o    o  pin 3 (int. 1)
 
24
//
 
25
// The two resistors in the circuit are pull-down resistors.  Without them, the
 
26
// Arduino is unable to read the pulse wave (I guess because of the diodes --
 
27
// it's fine without them!).
24
28
//
25
29
// (Note that on our receiver, and contrary to the above diagram, the channels
26
30
// are not actually sent in order.  Channels 2 and 3 are reversed.  To this end,