Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/28/09 13:24
Read: times


 
#169225 - still rather clunky!
Responding to: ???'s previous message
Ralf Altman said:
   Head1_ADC = ADC_read( 0x00 );
   Head2_ADC = ADC_read( 0x01 );
   // ...and so on


But don't you think that it's still rather cumbersome to have to write out essentially the same thing ten times?
What if you had 100 "head" values...?

And, back on the issue of style, please think about how a little whitespace goes a long way to make you code readable!

Whenyouwriteenglish,youdon'tsquashallyourwordstogetherlikethis,doyou?

So don't squash all your code together like this:
Head1_ADC=ADC_read(0x00);
Head2_ADC=ADC_read(0x01);

Space it out; eg, like this:
Head1_ADC = ADC_read( 0x00 );
Head2_ADC = ADC_read( 0x01 );

Precisely how you choose to space it out is a matter of personal preference - but anything must be better than nothing!

List of 14 messages in thread
TopicAuthorDate
ADuC848: Trouble of reading all 10 ADC channels, pleas help!            01/01/70 00:00      
   Watchdog?            01/01/70 00:00      
      Yes, it's watchdog reset problem!            01/01/70 00:00      
      Style            01/01/70 00:00      
   IF-ELSE problem            01/01/70 00:00      
      Re: IF-ELSE problem            01/01/70 00:00      
         still rather clunky!            01/01/70 00:00      
            Re: still rather clunky!            01/01/70 00:00      
               read all 10 ADC channels at once            01/01/70 00:00      
                  Re: read all 10 ADC channels at once            01/01/70 00:00      
                     Refresh            01/01/70 00:00      
                        Re: Refresh            01/01/70 00:00      
                           That slow?            01/01/70 00:00      
                              Re: That slow?            01/01/70 00:00      

Back to Subject List