scanf problem

Hello,I would like to read data from hyperterminal and use it in uvision for further calculation. however, It seems to me that scanf is not working.
Any help, will be appreciated.
thanks in advance.

int main (void)
{
float i;
printf ("Enter value");
scanf ("%f", &i);
}

Parents
  • Why do you want uvision to use data from the hyper terminal?

    You are aware, that uvision is the IDE (editor/debugger/compiler) you are using, aren't you? Yes - the debugger has a programming language, but not intended for processing data from the hyper terminal program.

    Next issue - if you do use uvision to write an embedded application and want that application to use printf() and scanf() you have to consider what device that is your console. Is it one of the UART? In that case - which of them? Or is it a SPI interface? Something else? Embedded devices don't normally come shipped from the manufacturer with a dedicated console - so you have to create the stub functions that integrates the runtime library with your actual hardware.

Reply
  • Why do you want uvision to use data from the hyper terminal?

    You are aware, that uvision is the IDE (editor/debugger/compiler) you are using, aren't you? Yes - the debugger has a programming language, but not intended for processing data from the hyper terminal program.

    Next issue - if you do use uvision to write an embedded application and want that application to use printf() and scanf() you have to consider what device that is your console. Is it one of the UART? In that case - which of them? Or is it a SPI interface? Something else? Embedded devices don't normally come shipped from the manufacturer with a dedicated console - so you have to create the stub functions that integrates the runtime library with your actual hardware.

Children
More questions in this forum