Subject: Re: Double to float



Hi guys,

I am new to lejos and I am trying to make a Robot Navigation system. I have hooked up rotation sensors to both of my wheels and I am trying to sample their values periodically( after every 5 sec). But the values I read do not make any sense.

For eg,
left sensor right sensor
353 354
1024 552
447 772

...

My rotation sensors are set up in raw mode and i am using readValue(). I have tried it in angle mode too but I have the same problem.

Anyone knows whats going on?

Thanks,

Jyoti.


From: "Lawrie Griffiths" <[email protected]>
To: "jyoti gandhe" <[email protected]>,<[email protected]>
Subject: Re: [Lejos-discussion] Double to float
Date: Wed, 23 Apr 2003 21:59:07 +0100

Jyoti,

doubles and floats are the same thing on lejos, so there is no real point in
using double.

> If your code needs to use doubles for some reason, a cast should work:

double d = 1.23f;
float f = (float) d;

Have you tried this? Does it not work?

Lawrie

----- Original Message -----
From: "jyoti gandhe" <[email protected]>
To: <[email protected]>
Sent: Wednesday, April 23, 2003 8:25 PM
Subject: [Lejos-discussion] Double to float


>
> Can anyone tell me how to convert double value to float value in Lejos.
> Stupid as it may sound, I have been at it for two days now with no
success.
>
> Thanks...

,
> Jyoti.
>
>
>
>
> _________________________________________________________________
> MSN Instyle. Keeps you in sync. http://server1.msn.co.in/instyle/index.asp
> Always!
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Lejos-discussion mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/lejos-discussion



_________________________________________________________________
Hot new gizmos. Check 'em out. http://www.msn.co.in/Computing/Gizmos/ Right now!



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




Programming list archiving by: Enterprise Git Hosting