- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am new for this area and I need a help for sending real numbers from PSOC 5LP to PC for reading it with c# .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since the representation of floats as binary may vary from your source and target machines, best would be to use printf() ans scanf().
Easiest on PSoC5 side is fprintf() and then send the converted srting over USBUART and on the other side receive a string that can be converted using fscanf().
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry I didn't explain situation clearly, I have some graph (with real values like "2.036" or "-0.145") in my PSOC 5LP ( it has not end and gives value every 0.001 sec) I want to sent this graph's values to PC with usb uart for plotting this graph on PC. Which function (USBUART_PutData(), USBUART_PutString(), USBUART_PutChar(), USBUART_PutCRLF()) can I use in this situation and which kind of data must I sent to PC and ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I said: Convert the double value into a string with sprintf() and then send the string with USBUART_PutString()
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for answer, now i can convert data to int then send it with PutData() and then again convert it to double, this is better for my project.