Browse Source

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
mission-4.1.18
analoguedevices 15 years ago
parent
commit
8a82413080
  1. 2
      libraries/APM_ADC/APM_ADC.cpp

2
libraries/APM_ADC/APM_ADC.cpp

@ -66,7 +66,7 @@ ISR (TIMER2_OVF_vect) @@ -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

Loading…
Cancel
Save