filter

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
feme_285141
Level 4
Level 4

as I convert the value to the filter med (Filter_Read8 ()) to numerical voltage value ??

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

View solution in original post

0 Likes
3 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

???

   

 

   

Bob

0 Likes
feme_285141
Level 4
Level 4

 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);
    }
    
}

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

0 Likes