/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: dan
  • Date: 2016-04-10 17:32:35 UTC
  • Revision ID: dan-20160410173235-f8nuezes02j1xm21
Modified Schimatic to incorperate pin out for Serial 3 and freed up serial 1 (for use as interupt)

Show diffs side-by-side

added added

removed removed

20
20
//             R                    |    |                     R
21
21
//             ____________________ | __ | _____________________
22
22
//                                  |    |
23
 
//                  (int. 0) pin 2  o    o  pin 3 (int. 1)
 
23
//                           pin 2  o    o  pin 3
 
24
//                    (interrupt 0)        (interrupt 1)
24
25
//
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!).
 
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.
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
 
 
117
114
bool read_channels( unsigned long channel_values[] )
118
115
{
119
116
        static unsigned long last_pulse_down = 0;