I am new to programming microcontrollers, and I am just trying to write a simple program that echos back the characters to the screen. I first started off by trying to read from the serial port but then got this error: *** ERROR L104: MULTIPLE PUBLIC DEFINITIONS SYMBOL: getchar?T MODULE: C:\KEIL\ARM\LIB\CAL.LIB (getchar) DEFINED: .\XFLASH\Serial.obj (Serial) I am just using the defualt function from one of the demos:
int getchar (void) { /* Read character from Serial Port */ while (!(U0LSR & 0x01)); return (U0RBR); }
char c='0'; int argsread =0; while (1) { printf ("Enter a byte\n");/ argsread = scanf("%bd",&c); printf("Arguments read: %d\n",argsread); }
Thanks everyone. I just had to change to using _getkey.