8 years, 7 months ago.

serial communication

hello, when i am trying to send string with more than 3 character it cant print on serial monitor. it only print always when we use upto 3 character. why?? give me solution for long string. here is my program:

  1. include "mbed.h"

Serial pc(USBTX, USBRX, 9600);

int main() { char buffer[128];

while(1) { pc.gets(buffer, 7); if(strcmp(buffer,"somesh")==0) { pc.printf("Hii '%s'\nWELCOME TO ARM Mbed.\n\n", buffer);

} } }

Be the first to answer this question.