??? 02/25/08 12:58 Read: times Msg Score: -1 -1 Answer is Wrong |
#151391 - THINK Responding to: ???'s previous message |
#include <reg52.h> #define MAX_LINES 3 #define MAXCHARS_ON_LINE 10 #define CHAR_MASK 0xBF #define high 1 #define low 0 sbit clear = P3^0; sbit write = P3^1; #define uint unsigned int #define uchar unsigned char void msec(uint x) { uchar j; while (x-->0) {for(j=0;j<125;j++); }} void code clear_display() { clear=high; clear=low; clear=high;} void code write_enable() {write=high; write=low; write=high;} void code word_delay() {msec(3500);} unsigned char code *phrases2[] = { "Short", "Medium", "Very long" }; void put_phrase( unsigned char line_no ) { while (*phrases2[line_no] != 0x00) { P0 = *phrases2[line_no]; ++phrases2[line_no]; write_enable();}} void main( void ) { clear_display(); for(;;) { unsigned char line_no; for ( line_no = 0; line_no < MAX_LINES; line_no++ ) {put_phrase( line_no ); word_delay(); clear_display();}}} /* :03000000020003F8 :0C000300787FE4F6D8FD75810E02004AFB :1000EE0053686F7274004D656469756D0056657264 :0700FE0079206C6F6E6700B2 :08010500060800EE00F400FB07 :1000D300EF1FAA0670011ED39400EA9400400BE4BC :0A00E300FDEDC3947D50E90D80F798 :0100ED0022F0 :07010E00D2B0C2B0D2B02252 :07011500D2B1C2B1D2B12248 :07011C007FAC7E0D0200D351 :10008F00EF25E02408F8E6FC08E6F5828C83E4937C :10009F00FE6014F580EF25E02408F80806E61870D6 :0800AF00010612011580D9229F :0300B70012010E25 :1000BA00E4F50EAF0E12008F12011C12010E050E8E :0900CA00E50EC3940340EC80E74D :10000F000200B7E493A3F8E493A34003F68001F250 :10001F0008DFF48029E493A3F85407240CC8C333F2 :10002F00C4540F4420C8834004F456800146F6DFC1 :10003F00E4800B0102040810204080900105E47E4B :10004F00019360BCA3FF543F30E509541FFEE493B6 :10005F00A360010ECF54C025E060A840B8E493A37D :10006F00FAE493A3F8E493A3C8C582C8CAC583CAA8 :10007F00F0A3C8C582C8CAC583CADFE9DEE780BE60 :01010D0000F1 :00000001FF */ |