/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

Lines of Context:
20
20
//             R                    |    |                     R
21
21
//             ____________________ | __ | _____________________
22
22
//                                  |    |
23
 
//                           pin 2  o    o  pin 3
24
 
//                    (interrupt 0)        (interrupt 1)
 
23
//                  (int. 0) pin 2  o    o  pin 3 (int. 1)
25
24
//
26
 
// The two resistors in the circuit are pull-down resistors (so, say 100kΩ).
27
 
// Without them, the Arduino is unable to read the pulse wave at all.
 
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!).
28
28
//
29
29
// (Note that on our receiver, and contrary to the above diagram, the channels
30
30
// are not actually sent in order.  Channels 2 and 3 are reversed.  To this end,
111
111
}
112
112
 
113
113
 
 
114
static int count_ = 0, good_ = 0;
 
115
 
 
116
 
114
117
bool read_channels( unsigned long channel_values[] )
115
118
{
116
119
        static unsigned long last_pulse_down = 0;