??? 03/15/05 07:10 Read: times |
#89697 - Counting should be easy! Responding to: ???'s previous message |
Rahul Sadagopan said:
I guess all would have figured out im new to microcontrollers and programming. Yes - which is precisely why Michael said at the very start that this is not a good approach for you to take. The result would be a nightmare for even an expert to debug and maintain! Anyways....I've written separate functions for all characters to be printed
say for A A() { /*** the list of pins in the required order to be fired ****/ } This is not a good idea. Far better would be to use a lookup table (or lookup tables) - do a search for "lookup table" (or "look-up table"). Then you'd just have a single print_character function that would take the character to be printed as a parameter, and obtain its list of pins to fire from the lookup table(s). Your print_character function should return the width of the character it has just printed - so that counting is simply a matter of keeping a running total, as I've already shown. |