View Single Post
  #6   Spotlight this post!  
Unread 24-01-2002, 16:43
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is online now
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,644
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Order what you want, eat what you order...

I agree with Steve and Nate. I have this to add, though.

Basically you have a menu to pick from by setting the c_variablename constanst to 1 or 0. Once you pick from the menu, your choices get sent to the kitchen via the shiftout command you are asking about. It is your job to make sure you order what you wanted because that is what the master CPU is going to send you 40 times a second for the rest of your life (or until you reprogram your STAMP2).

As to your particular question, all those lines of code are turning your menu choices into the right string to output via the shiftout command.

Basically, by shifting left and adding in new constants that are either 1 or 0, you are building up a constant that has 1's and 0's in the right place for the shiftout command.

If you are a coding "tough guy" you can set the bits directly by just assigning dataInitA etc. to something in one step (e.g. dataInitA=$F8). While it is possible to do this, it is silly and very likely to cause you grief.

In the end, the best thing is to use the code as Innovation First intended.

Joe J.