??? 02/23/08 10:35 Read: times |
#151324 - You don't want to start from here! Responding to: ???'s previous message |
I thought you said the idea of this was to give to a non-programmer so that he could modify the strings?
No programmer should be expected to have to manually count the numbers of characters in the strings, manually ensure that they're all uppercase, or manually copy & paste whole blocks of code just to add another string. And this should certainly not be expected of a non-programmer! What you want is something more like: <pre> code char strings[] = { "CALIBRATE", "L. TURBINE", "R. TURBINE", "CMB", "" // This must always be at the END of this list! }; // Display the specified phrase void display_phrase( char *phrase ) { clear_display(); // Display each character until the NUL terminator is reached. while( phrase ) { P0 = (phrase++ & 0xBF); write_enable(); } word_delay(); } void main() // Main function { clear_display(); for(;;) // Loop this process forever { display_phrase( strings[0] ); display_phrase( strings[1] ); display_phrase( strings[2] ); display_phrase( strings[3] ); } }<pre> That's an outline - not compiled & tested code! You should build the checks for things like overlength strings & non-uppercase into display_phrase(). |