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/04 12:00
Read: times


 
#78259 - RE: Programming style
Responding to: ???'s previous message
Are you sure that the first part of your program will count as a decade counter ? When a digit reaches 9, it is changed to 0 before increment ?

Also the programming style is not to be proud of. I would suggest the following:
	i=0;
	counted_pulses[i]++;
	while ((counted_pulses[i]>=10)&&i<4) {
	   counted_pulses[i]=0;
	   i++;
	   counted_pulses[i]++;
	   }
It's shorter and more clear. It's made for 4 digits, 0 is the lowest. (I haven't tried the program).

Regards, Slobodan

List of 26 messages in thread
TopicAuthorDate
Keil strncpy function doubt?????            01/01/70 00:00      
   RE: Keil strncpy function doubt?????            01/01/70 00:00      
      RE: Keil strncpy function doubt?????            01/01/70 00:00      
   RE: Keil strncpy function doubt?????            01/01/70 00:00      
      RE: Keil strncpy function doubt?????            01/01/70 00:00      
         RE: Keil strncpy function doubt?????            01/01/70 00:00      
            Encoder Direction            01/01/70 00:00      
               RE: Encoder Direction            01/01/70 00:00      
                  RE: Encoder Direction            01/01/70 00:00      
                     RE: Encoder Direction            01/01/70 00:00      
                        RE: Encoder Direction            01/01/70 00:00      
                           RE: Encoder Direction            01/01/70 00:00      
                              RE: Encoder Direction            01/01/70 00:00      
                     RE: Encoder Direction            01/01/70 00:00      
                        Thanks a *            01/01/70 00:00      
                        Need help for low ESR Capacitors            01/01/70 00:00      
         RE: Keil strncpy function doubt?????            01/01/70 00:00      
      RE: Keil strncpy function doubt?????            01/01/70 00:00      
   RE: Programming style            01/01/70 00:00      
      RE: Programming style            01/01/70 00:00      
      RE: Programming style            01/01/70 00:00      
   RE: Keil strncpy function doubt?????            01/01/70 00:00      
      RE: Keil strncpy function doubt?????            01/01/70 00:00      
         RE: Keil strncpy function doubt?????            01/01/70 00:00      
   Copying structures            01/01/70 00:00      
      RE: Copying structures            01/01/70 00:00      

Back to Subject List