From 8a82413080eff00356bede43b66e112f34145515 Mon Sep 17 00:00:00 2001 From: analoguedevices Date: Mon, 5 Jul 2010 00:54:36 +0000 Subject: [PATCH] Correct FOR loop that didn't get to channel 8 git-svn-id: https://arducopter.googlecode.com/svn/trunk@39 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/APM_ADC/APM_ADC.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/APM_ADC/APM_ADC.cpp b/libraries/APM_ADC/APM_ADC.cpp index 7a49da4e5d..002211eba9 100644 --- a/libraries/APM_ADC/APM_ADC.cpp +++ b/libraries/APM_ADC/APM_ADC.cpp @@ -66,7 +66,7 @@ ISR (TIMER2_OVF_vect) //bit_set(PORTL,6); // To test performance bit_clear(PORTC,4); // Enable Chip Select (PIN PC4) ADC_SPI_transfer(adc_cmd[0]); // Command to read the first channel - for (ch=0;ch<7;ch++) + for (ch=0;ch<8;ch++) { adc_tmp = ADC_SPI_transfer(0)<<8; // Read first byte adc_tmp |= ADC_SPI_transfer(adc_cmd[ch+1]); // Read second byte and send next command