- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Being very experienced hardware guy, I have UART sending info to host computer. However I can only send ascii characters (just to verify it all works). But I can't figure out what to do in code. Tried using sprintf to convert, etc, but so far nothing works. So, pretend I have a value, a=57, for example. How do I process that and use UART calls to send it out ?
Thank you. Bob
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Welcome in the forum, Bob.
The magic word is: sprintf(), or rather the magic function. Look here publications.gbdirect.co.uk/c_book/chapter9/formatted_io.html
You simply convert a value (int, char, float...) into a string (see that it is big enough!) and send it via UART.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One comment. It seems that the default heap size (128 bytes) used by Creator 3.1 is too small for all the printf-related stuff. So open the *.cydwr file and set it to something like 1024 bytes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content