/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-20 23:59:59 UTC
  • Revision ID: tim@ed.am-20131120235959-hh2y1ickvxf2z0lt
added pulse-width reading test program that reads all 8 channels

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
//                  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!).
 
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)
28
24
//
29
25
// (Note that on our receiver, and contrary to the above diagram, the channels
30
26
// are not actually sent in order.  Channels 2 and 3 are reversed.  To this end,