??? 07/20/05 09:02 Read: times |
#97670 - Ridicule Responding to: ???'s previous message |
Adam Klaum said:
I just wanted to share the fruits of that help with the group Great! As I stated before, I am farily new to ANSI C and very new to 8051 programming so this has been an adventure. I post the code below for all to enjoy (or ridicule) as desired. Looks pretty good. Just a couple of "style" points: This isn't a good idea, as it may upset some compilers. I would tend to avoid trying to put any border down the right-hand side of a comment like that - it looks neat to start with, but is a nightmare to maintain when you need to update the comment... Walk(8,5); // Walk forward 5 cycles Walk(2,5); // Walk backward 5 cycles Walk(6,3); // Turn right 3 cycles Walk(4,3); // Turn left 3 cyclesIt'd be easier to read & maintain if you used an enum or #defined names; eg, Walk( FORWARD, 5 ); // Walk forward 5 cycles Walk( BACKWARD, 5 ); // Walk backward 5 cycles Walk( RIGHT, 3 ); // Turn right 3 cycles Walk( LEFT, 3 ); // Turn left 3 cycles |