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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/22/07 18:34
Read: times


 
#131218 - this helps a lot
Responding to: ???'s previous message
Russ,

This helps me a lot. Just a few things I'm ashamed to admit that I don't understand what some of these lines do. As we didn't cover them in C class...

1. "#define A_0 (A_I0 | A_I1)" - everytime i type in A_0 it gets or'd with A_I0 and A_I1?

2. "static code char sequence[] = {
A_MINUS | A_0 | B_PLUS | B_67,
A_PLUS | A_33 | B_PLUS | B_67,
A_PLUS | A_67 | B_PLUS | B_67,
A_PLUS | A_67 | B_PLUS | B_33,
A_PLUS | A_67 | B_PLUS | B_0,
A_PLUS | A_67 | B_MINUS | B_33,
A_PLUS | A_67 | B_MINUS | B_67,
A_PLUS | A_33 | B_MINUS | B_67,
A_PLUS | A_0 | B_MINUS | B_67,
A_MINUS | A_33 | B_MINUS | B_67,
A_MINUS | A_67 | B_MINUS | B_67,
A_MINUS | A_67 | B_MINUS | B_33,
A_MINUS | A_67 | B_MINUS | B_0,
A_MINUS | A_67 | B_PLUS | B_33,
A_MINUS | A_67 | B_PLUS | B_67,
A_MINUS | A_33 | B_PLUS | B_67
};"
What is a static code char sequence[]? My guess is that it's an array with 16 values. What does the word static do for the array?

3. "#define set_motor(X) P1 = (P1 & 0xC0) | X" - I'm a bit confused with this line - the tutorial i read about macro's gave me this form "#define MULT(x, y) x * y" where whatever i typed in for x and y would be multiplied.

If you could please just teach me those few C concepts I think I can wrap my head around the rest.

Thanks very much for this,

Roque

List of 22 messages in thread
TopicAuthorDate
8051 & L6219 (Stepper Motor Driver)            01/01/70 00:00      
   CNCZone            01/01/70 00:00      
   Maybe this will help            01/01/70 00:00      
      this helps a lot            01/01/70 00:00      
         Think Search and Replace            01/01/70 00:00      
            static            01/01/70 00:00      
               static about 'static' and 'code'            01/01/70 00:00      
                  That's modularity for you!            01/01/70 00:00      
                  Different Reason            01/01/70 00:00      
         Concepts            01/01/70 00:00      
      Imprecise comment            01/01/70 00:00      
         Another imprecise comment            01/01/70 00:00      
            Ah... That is the catch :)            01/01/70 00:00      
            Better            01/01/70 00:00      
               Yup            01/01/70 00:00      
                  Works Beautifully            01/01/70 00:00      
                     Another happy ending            01/01/70 00:00      
                        One more problem - Direction            01/01/70 00:00      
                           Extra Table Shouldn't Be Necessary            01/01/70 00:00      
                              thats what i thought too            01/01/70 00:00      
      nevermind i screwed up...            01/01/70 00:00      
   Visit Jones on Stepping Motors            01/01/70 00:00      

Back to Subject List