/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 src/rc-interface/receiver.cc

  • Committer: dan
  • Date: 2014-04-15 02:30:19 UTC
  • Revision ID: dan-20140415023019-u1qz3nxv08vpxb4s
First attempt at connecting up all the components on the circuit. Almost finnished but not managed to connect scl, sda, tx0 & rx0. Gonna pass over to Tim to see if he can find a solution.

Show diffs side-by-side

added added

removed removed

5
5
 
6
6
#include "receiver.h"
7
7
#include "config.h"
 
8
#include "common.h"
8
9
#include <Arduino.h>
9
 
#include <limits.h>
10
10
 
11
11
 
12
12
// channel sequence order
55
55
}
56
56
 
57
57
 
58
 
static unsigned long calculate_duration( unsigned long then, unsigned long now )
59
 
{
60
 
        return now - then;
61
 
        
62
 
        if( now < then )
63
 
                return now + ( ULONG_MAX - then );
64
 
        else
65
 
                return now - then;
66
 
}
67
 
 
68
 
 
69
58
bool Receiver::read_channels( int channel_values[] )
70
59
{
71
60
        static unsigned long last_pulse_down = 0;