Re: Using floating point in driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Karl Hiramoto wrote:
> viper@xxxxxxxxxxx wrote:
>   
>> Thx. Any method to read in floating point value like "2.5"? 
>>     
>
> One way is to just change your units..    For example instead of 2.5 
> meters  use 2500 mm.    Or use fixed point math.
>   
For a servo, you could specify:

* angle in degrees: 0 to 180
* percent of total range: 0 to 100
* microseconds of pulse width: 1000 to 2000

I generally try to avoid floating point wherever possible, it's an 
embedded programming habit.

Aras

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

[Linux ARM]     [Linux ARM MSM]     [Linux ARM Kernel]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

Add to Google Follow linuxarm on Twitter