Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT+ Fitness Equipment → Thread

   

decimal values in 1 Byte

Rank

Total Posts: 2

Joined 2010-04-12

PM

I'm working on a FE-C profile for a bicycle trainer. For page 17 of general data, byte 3 stores cycle length which for a trainer is wheel circumference in meters:

3 Cycle length 1 Byte Length of one ‘cycle’ (section 7.5.3.1). 0xFF indicates invalid 0.01 meters 0 - 2.54 m

I'm a newbie, it is late. I am tired and need help figuring out how to store a decimal value into the 1 byte field.

everything I've done previously requires 4 bytes to store a float

How do the pros do it in 1 byte?      
Rank

Total Posts: 2

Joined 2010-04-12

PM

Is it as easy as 2.54 equal 254?      
RankRankRankRank

Total Posts: 120

Joined 2013-05-07

PM

Hi Ross,

Yes, it is that easy. The Units column tells you how to interpret the value field. For cycle length, the units are described as 0.01 meters. This means that if a value of 1 is stored, it should be interpreted as 0.01 meters. And therefore the range of the field is 0 - 2.54 m.

BK.