Permalink
Browse files

Small optimization

  • Loading branch information...
1 parent 57c8876 commit 5e9fbdb21e2bc1b8a8d28803003c978feee12d14 @grantmd committed Oct 23, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 Receiver.cpp
View
@@ -34,13 +34,14 @@ Receiver::Receiver(){
channels[GEAR_CHANNEL] = 7; // Gear
channels[AUX_CHANNEL] = 8; // Aux / Flt Mode
+ int i;
// Assign all pins for reading
- for (int i=0; i<CHANNELS; i++){
+ for (i=0; i<CHANNELS; i++){
pinMode(channels[i], INPUT);
}
// Init the readings at something sensible
- for (int i=0; i<CHANNELS; i++){
+ for (i=0; i<CHANNELS; i++){
smoothed[i] = (i == THROTTLE_CHANNEL) ? 1000 : 1500;
readings[i] = smoothed[i];
}

0 comments on commit 5e9fbdb

Please sign in to comment.