??? 03/26/07 16:52 Read: times |
#135907 - check this out, Eugene... Responding to: ???'s previous message |
Your code can look like this:
char modem_receive() { char str[10]; // Array for storing string of response from modem. int n=0; TH1 = 0xFF; // 19200 BAUD @ 11,059,000 Hz SCON = 0x50; // Serial Mode 1, REN = 1 do { RI = 0; // Reset RI Flag TR1 = 1; // Run Timer1 while (RI == 0); // Wait receive data complete TR1 = 0; // Stop Timer1 if( SBUF != '\n') // If character received is not carriage return, stroe character in array str[] { str[n] = SBUF; n++; } } while( SBUF != '\n'); return str; } by using the prefix "pre" and suffix "/pre" around your text... surround the commands in "<>" |