- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
http://www.planetpsoc.com/comp...integer-to-ascii.html
If you want to convert an ascii string to integer, then you could use the atoi function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Best Regards,
CAI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ganesh,
I'm sorry if this is obvious, but i cant seem to get the code working.
When I use the following code sample in the article:
char *itoa(char *string, int value, int base);
char AsciiString[7]; //Buffer to Store the ASCII
UART_1_PutString(itoa(AsciiString, Sample_Value, 10));
(Where Sample_Value is the int im trying to convert and transfer over UART - it is an ADC code)
I get the following error:
prj.M0120: implicit declaration of function 'itoa'
prj.M0120: incompatible implicit declaration of function 'itoa'
prj.M0121: Passing argument 1 of 'UART_1_PutString' makes pointer from integer without a cast
Please help!
Thank you in advance,
Anish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Anish,
Sounds like you forgot to include the StdLib library -
#include “stdlib.h”
that should fix it...
regards,
Tom Moxon