/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-freq/main.ino

  • Committer: Tim Marston
  • Date: 2013-10-23 20:08:35 UTC
  • Revision ID: tim@ed.am-20131023200835-zqu4je2gn0y79car
fixed receiver test code which is now working

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
                {
51
51
                        // check interval
52
52
                        unsigned long interval = new_pulse - last_pulse;
53
 
                        if( interval < 300 )
 
53
                        if( false && interval < 300 )
54
54
                        {
55
55
                                Serial.print( "[" );
56
56
                                Serial.print( last_pulse );
75
75
                if( interval_idx == 0 && got_pulse )
76
76
                {
77
77
                        // calculate average
78
 
                        for( int a = 0; a < SIGNAL_SAMPLES; a++ ) {
79
 
                                Serial.print( intervals[ a ] );
80
 
                                if( a == SIGNAL_SAMPLES - 1 )
81
 
                                        Serial.println();
82
 
                                else
83
 
                                        Serial.print( " " );
84
 
                        }
 
78
                        long interval = 0;
 
79
                        for( int a = 0; a < SIGNAL_SAMPLES; a++ )
 
80
                                interval += intervals[ a ];
 
81
                        
 
82
                        Serial.print( intervals[ 0 ] );
 
83
                        Serial.println();
85
84
                }               
86
85
        }
87
86
}