This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

scanf does not work

Hello,

I have include stdio.h library file and configure uart . Used printf to print data over uart to terminal. Now I wants same thing reverse get data(scanf) from terminal (via uart). But I am failing to get data.

Can any one help me how can I get data from terminal(via uart) ?

Regards, Rajneesh

Parents
  • Hi,

    I'm not sure that I understand your question.

    There's no scanf() in the code, characters either come over the UART or they come over the connection from the app/ other device.

    The data from UART is read by the function app_uart_get(&data_array[index]) in the uart_event_handle().

    Best regards,

    Øyvind

  • Well, you can set up the receiver so that it the receiver triggers on newlines for example. And also have the transmitter send a newline at the end of each command, for example when enter is pressed.

Reply
  • Well, you can set up the receiver so that it the receiver triggers on newlines for example. And also have the transmitter send a newline at the end of each command, for example when enter is pressed.

Children
No Data