2015-12-31 07:02 AM
hi every one
is there any special function for this purpose ? i am currently read characters byte by byte and compare them with desire character but i dont know why it does not work some time my way :do
R_Buffer=usart_reci(1);//function of receiving characters from usart 1 its work correctly
while( R_Buffer=='o'| R_Buffer=='O');
best regards
2015-12-31 09:34 AM
Well C has a number of string and tokenizing functions.
The kind of stuff you're taking about at a character level really requires you to do the work, perhaps with a state machine implementation, with the ability to resynchronize at a line or character level if the expected sequencing fails. Note also that you want the '||' form of OR not the ''|' form for the loop test you are using.