- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
as I convert the value to the filter med (Filter_Read8 ()) to numerical voltage value ??
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I assume v is calculated correctly, you may check that in debugger.
To print a float:
Set the heap size to 0x200 (.cydwr view -> System tab)
Set Use newlib-nano and Use newlib-nano float formatting both to TRUE (Project -> Build settings -> Linker)
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
???
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
for(;;)
{
/* Poll waiting for the holding register to have data to read */
while (Filter_IsInterruptChannelA() == 0) ;
num = (Filter_Read8(Filter_CHANNEL_A));
v = ((num*5.00)/255);//// Problem ??????????????????????????
sprintf((char *)wrBuffer, "v = %2.f\n\r",v);
PrintToUSBUART((char8 *)wrBuffer);
CyDelay(1000);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I assume v is calculated correctly, you may check that in debugger.
To print a float:
Set the heap size to 0x200 (.cydwr view -> System tab)
Set Use newlib-nano and Use newlib-nano float formatting both to TRUE (Project -> Build settings -> Linker)
Bob