/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/motors.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 "motors.h"
7
7
#include "config.h"
 
8
#include "common.h"
8
9
#include <Arduino.h>
9
10
#include <limits.h>
10
11
 
73
74
                //      Serial.println( width );
74
75
                // }
75
76
        }
 
77
 
 
78
        // else, if an event is coming up soon, sleep and service the event to make
 
79
        // sure that no other code runs and blocks us!
 
80
        else
 
81
        {
 
82
                long delay = calculate_duration( now, next_event_at );
 
83
                if( delay < 250 )
 
84
                {
 
85
                        if( delay > 20 )
 
86
                                delayMicroseconds( delay - 20 );
 
87
                        update();
 
88
                }
 
89
        }
 
90
        
76
91
}