kef,
Thanks for replying!
TERMIO_GetChar() is working. Inspired from your concern, I used this TERMIO_GetChar() function instead of scanf(). The program took the inputs from keyboard.
Below is the output I got from Terminal
Input a 16-character string:
The string is Test message 01.ZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
84 101 115 116 32 109 101 115 115 97 103 101 32 48 49 46
It is weird that there are some Z's following the message. Do you have any idea about why it happened?
Also, I am confused by the use of TERMIO. Why can I use printf() without any problem, but not scanf()?
Below is my main.c
#include <hidef.h> /* common defines and macros */#include "derivative.h" /* derivative-specific definitions */#include <TERMIO.h>#include <stdio.h>#include <stdlib.h>void main(void) { /* put your own code here */ int i; char words[16]; int asc[16]; TERMIO_Init(); printf("Input a 16-character string:\n"); for(i = 0; i < 16; i++) words[i] = TERMIO_GetChar(); //scanf("%s",&words); //fgets(words,strsize,stdin); printf("The string is %s\n", words); i = 0; while(words[i]!='\0') { asc[i] = (int)words[i]; printf("%d ",asc[i]); i++; } EnableInterrupts; for(;;) { _FEED_COP(); /* feeds the dog */ } /* loop forever */ /* please make sure that you never leave main */} Thanks!