uint32 to float conversion

A catchall for PSoC5 discussions not captured by the other forums.

Moderator: ericb

uint32 to float conversion

Postby AnanAshour » Sat Mar 22, 2014 6:01 am

hey I'm using 32-bit timer in psoc creater 2.1 SP1 with hardware capture mode , according to the datasheet of the timer the captured value should be stored in an uint32 and I need to subtract this value from the period and divide it on the frequency so i need to convert the uint32 to float
any help ?? thanks
Posts: 3
Joined: Sun Sep 15, 2013 12:27 pm

Re: uint32 to float conversion

Postby danadak » Sat Mar 22, 2014 3:15 pm

Just cast it -

Code: Select all
uint32 myint;
float myfloat;
myfloat = (float) myint;

Regards, Dana.
Field Application Engineer
KB1RHB Mostly listen :)
Semi Retired
User avatar
The Big Cheese
The Big Cheese
Posts: 2008
Joined: Thu Dec 27, 2007 8:42 am
Location: New Hampshire

Return to “%s” PSoC5 General

Who is online

Users browsing this forum: No registered users and 0 guests