Hello,
in a project, created with KDS 2.0.0, KSDK 1.1.0 and PE, I'm trying to create some user interaction with the console.
I added the fsl_debug_console component in PE.
I can output messages using debug_printf() and read 1 character using debug_getchar().
Now in fsl_debug_console.c there is the debug_scanf() funtion, that I expect to work like the classic scanf().
But it seems that it doesn't:
uint16_t choice; debug_printf("\nSet Year (last 2 digit): "); choice = debug_scanf("%d",&choice); debug_printf("%d\n",choice);
The input is "15\n", so I expect that the debug_printf() outputs "15\n", but the output is "1\n".
Am I doing something wrong?
Thanks, regards Giacomo
Solved! Go to Solution.
Hello giacomopetrini,
the bad thing is, that you assign debug_scanf("%d",&choice) to choice.
You must do it by this way:
uint16_t choice;
debug_printf("\nSet Year (last 2 digit): ");
debug_scanf("%d",&choice);
debug_printf("%d\n",choice);
Best Regards,
Iva
Hello giacomopetrini,
the bad thing is, that you assign debug_scanf("%d",&choice) to choice.
You must do it by this way:
uint16_t choice;
debug_printf("\nSet Year (last 2 digit): ");
debug_scanf("%d",&choice);
debug_printf("%d\n",choice);
Best Regards,
Iva
...
...
I'm an idiot.
Thanks
Best Regards Giacomo
That´s ok :smileywink:
Best Regards,
Iva