Page 2 of 5

Re: temperature

Posted: Wed Nov 10, 2010 12:12 am
by WinterMute
I guess "lazyprogrammer" is more of a lifestyle choice than a forum nickname :wink:

Re: temperature

Posted: Wed Nov 10, 2010 2:47 pm
by lazyprogramer
Get ready here comes the baby spoon... temp is the temperature in degrees celcius in 20.12 fixed point - divide the number by 4096 (2 to the 12th power) to convert it to an integer.

Seriously though, asking for help and putting in no effort on your part is really annoying.

So I should do it like this:

if I have the numbers:
739 844 112842

39844.112842 / 4096 = 9.7... degrees celsius

Is this correct?
Can you please post the code, because I'm not sure what you mean with the fixpoint... 20.12 means 100°C???Wich fixpoint do you mean and what does this point mean??
I guess "lazyprogrammer" is more of a lifestyle choice than a forum nickname
In the real life I'm really NOT LAZY, but when i program i can be different

Re: temperature

Posted: Wed Nov 10, 2010 2:57 pm
by elhobbs
lazyprogramer wrote:So I should do it like this:

if I have the numbers:
739 844 112842

39844.112842 / 4096 = 9.7... degrees celsius

Is this correct?
no and no.

not that you are on the right track... why did you drop the 7 at the beginning? why do you think that 3 numbers separated by spaces are all part of the same number?

Re: temperature

Posted: Wed Nov 10, 2010 7:23 pm
by zeromus
t1 and t2 are irrelevant. all youre interested in is temp which is 20.12 fixed point degrees in celsius

Re: temperature

Posted: Wed Nov 10, 2010 9:03 pm
by lazyprogramer
not that you are on the right track... why did you drop the 7 at the beginning? why do you think that 3 numbers separated by spaces are all part of the same number?
I don't know, so please can you just give me the right solution?

t1 and t2 are irrelevant. all youre interested in is temp which is 20.12 fixed point degrees in celsius
okay...
And how should I write it in the code??
Please just give me the code then I will understand it.

Re: temperature

Posted: Wed Nov 10, 2010 11:07 pm
by zeromus
float celsius = temp/4096.0f;

do yourself a favor and re-evaluate your choice of hobbies.

Re: temperature

Posted: Thu Nov 11, 2010 4:33 pm
by lazyprogramer
okay...
thanks

Re: temperature

Posted: Sun Nov 14, 2010 3:18 pm
by lazyprogramer
I didnt understand it.

Re: temperature

Posted: Wed Nov 24, 2010 2:18 am
by Jordan_Gray
All I can say is wow.

Just reading this, I laughed out loud.

Seriously, give lazyprogrammer a break. He has no idea what he's asking, and you should maybe get him to clarify that a little.

Being somewhat new to programming the DS, though, this post caught my eye. I had no idea there were temperature sensors in the screens. Can they be read individually (as in, read two different temperatures)? Even if the programming/hardware isn't made that way, I would still love to learn how to read them. Where would I find out more information (aside from just going "Here's my open mouth. Feed me. Now.")? I tried googling it and found this, this, and this. However, none of it seemed to tell me what I was looking for, as in: what exactly do I need to type to read the sensors directly? I don't mind doing a little bit of math to calculate the answer in Kelvins, ºC, or even ºF, I just am wandering what I need to type in a homebrew app to read the temperature.

- Stryker

Re: temperature

Posted: Wed Nov 24, 2010 5:22 pm
by elhobbs
Jordan_Gray wrote:All I can say is wow.

...clipped...

I just am wandering what I need to type in a homebrew app to read the temperature.

- Stryker
the answer is in the thread - wow indeed :)