temperature

WinterMute
Site Admin
Posts: 1845
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: temperature

Post by WinterMute » Wed Nov 10, 2010 12:12 am

I guess "lazyprogrammer" is more of a lifestyle choice than a forum nickname :wink:
Help keep devkitPro toolchains free, Donate today

Personal Blog

lazyprogramer
Posts: 85
Joined: Mon Sep 27, 2010 5:26 pm

Re: temperature

Post by lazyprogramer » Wed Nov 10, 2010 2:47 pm

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

elhobbs
Posts: 358
Joined: Thu Jul 02, 2009 1:19 pm

Re: temperature

Post by elhobbs » Wed Nov 10, 2010 2:57 pm

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?

zeromus
Posts: 212
Joined: Wed Mar 31, 2010 6:05 pm

Re: temperature

Post by zeromus » Wed Nov 10, 2010 7:23 pm

t1 and t2 are irrelevant. all youre interested in is temp which is 20.12 fixed point degrees in celsius

lazyprogramer
Posts: 85
Joined: Mon Sep 27, 2010 5:26 pm

Re: temperature

Post by lazyprogramer » Wed Nov 10, 2010 9:03 pm

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.

zeromus
Posts: 212
Joined: Wed Mar 31, 2010 6:05 pm

Re: temperature

Post by zeromus » Wed Nov 10, 2010 11:07 pm

float celsius = temp/4096.0f;

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

lazyprogramer
Posts: 85
Joined: Mon Sep 27, 2010 5:26 pm

Re: temperature

Post by lazyprogramer » Thu Nov 11, 2010 4:33 pm

okay...
thanks

lazyprogramer
Posts: 85
Joined: Mon Sep 27, 2010 5:26 pm

Re: temperature

Post by lazyprogramer » Sun Nov 14, 2010 3:18 pm

I didnt understand it.

Jordan_Gray
Posts: 23
Joined: Sat Jun 12, 2010 3:31 am

Re: temperature

Post by Jordan_Gray » Wed Nov 24, 2010 2:18 am

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

elhobbs
Posts: 358
Joined: Thu Jul 02, 2009 1:19 pm

Re: temperature

Post by elhobbs » Wed Nov 24, 2010 5:22 pm

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 :)

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests