View unanswered posts | View active topics It is currently Wed Aug 15, 2018 1:59 am



Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
 temperature 
Author Message

Joined: Wed Mar 31, 2010 6:05 pm
Posts: 212
Quote:
Quote:
filling you guys in on what you don't know would take an entire textbook. the only specific guidance i can offer is to use the example in SVN and use it as a starting point, since you don't understand how to extract the relevant parts.
How about a yes/no question: can someone just type a few lines of code (or less) to read the temp sensors? I'm not even talking about gaining a ºC value from them, just reading them directly.

Yes. Be sure to type it into an arm7 program. Youve seen it already in this thread.

Quote:
Quote:
when you outgrow printf then advance to glut or sdl. thatll keep a fellow busy for a couple of years.
Great job showing off your vocabulary. Now say something useful.

You wouldn't know useful if it smacked you in the face. There wasnt vocabulary there, just a concise educational program which has serviced thousands of game programmers very well.


Wed Dec 01, 2010 4:27 am
Profile

Joined: Sat Jun 12, 2010 3:31 am
Posts: 23
Quote:
You wouldn't know useful if it smacked you in the face. There wasnt vocabulary there, just a concise educational program which has serviced thousands of game programmers very well.
That's the point. I am a newb. You are not. When you say something like that to us new people, it is really not helpful because we don't know what it means, and it just makes things more complicated.


Wed Dec 01, 2010 4:08 pm
Profile

Joined: Thu Jun 04, 2009 3:17 pm
Posts: 24
Location: Canada
This thread was finished on the first page and everything else should be deleted. Help was asked for, and appropriate help was given (in the context of programming on the DS).


Wed Dec 01, 2010 4:29 pm
Profile

Joined: Wed Mar 31, 2010 6:05 pm
Posts: 212
Jordan_Gray wrote:
Quote:
You wouldn't know useful if it smacked you in the face. There wasnt vocabulary there, just a concise educational program which has serviced thousands of game programmers very well.
That's the point. I am a newb. You are not. When you say something like that to us new people, it is really not helpful because we don't know what it means, and it just makes things more complicated.


The educational program had two steps. When you've completed the first step, youll know what the second step means. Until then, why should you expect to understand it?


Wed Dec 01, 2010 5:43 pm
Profile
User avatar

Joined: Fri Oct 19, 2007 10:57 pm
Posts: 107
Location: Costa Rica
Seriously, guys.

This isn't going anywhere.

Please resume the discussion about temperature reading (and this time, do it with sensible, reasonable arguments), or I'll be forced to move this pointless topic to "Offtopic" (or worse yet, delete the topic), since it's not helping *anyone* to improve his/her skills at DS programming.

Will you, please?


Fri Dec 03, 2010 7:13 pm
Profile WWW

Joined: Mon Sep 27, 2010 5:26 pm
Posts: 85
Yeah, let's talk about the temperature!


Fri Dec 03, 2010 9:52 pm
Profile

Joined: Thu Dec 16, 2010 3:50 pm
Posts: 2
lazyprogrammer fixed point maths:

[all of this assumed you are using unsigned ints]

your number 112842 is represented using 20.12 fixed point.
On the DS int = 32 bits. Notice 20+12=32! What is means
is that the first 20 bits of 112842 represent the whole part
of the temperature number and the last 12 represent the
fractional part.

112842 =
000000000000011011100011001010

000000000000011011 = 27
100011001010 = 2250

The answer however is NOT 27.2250 The fractional part must
be converted before we can use it. The whole part can be used
as it is.

To convert the fractional part into decimal you take the number
of bits that are used for the fractional part of the number. 12 in
our case and do this 2^12 = 4096.

2250 / 4096 = ~0.55

So our answer is 27.55 C

You can divide the entire number by 2^12 and get the same answer.
I thought I'd show you how it was worked out first.

16.16 floating point would therefore use:
16 bits for the whole part of the number
16 bits for the fractional part
and to convert you would use 2^16 which is 65536


Thu Dec 16, 2010 4:56 pm
Profile
User avatar

Joined: Fri Jul 11, 2008 8:49 pm
Posts: 222
Location: The Netherlands
wow, 4 pages of talk and nobody asked why he needs the temperature in the first place...

anyway, people who want to learn what fixed point math is should read this:
http://www.coranac.com/tonc/text/fixed.htm

as for the u32 type:
http://libnds.devkitpro.org/a00132.html

as for the temperature itself: the temperature registers can only be read from the arm7 processor while you normally program just for the arm9 and use a default arm7 binary. so you would have to write a custom arm7 binary to read the temperature, use the fifo (which, in the context of libnds, is the mechanism that libnds uses for arm7<->arm9 communication) to send the temperature to the arm9 and print it from there. seeing as creating custom arm7 code and processor communication isn't exactly beginners stuff, I suggest you continue with some simpler stuff first or find an other solution for your problem. which brings us to the question that should have been asked first:

lazyprogramer, why do you need the temperature?

_________________
my blog:
http://vuurrobin.100webcustomers.com/


Thu Dec 16, 2010 9:50 pm
Profile WWW

Joined: Mon Sep 27, 2010 5:26 pm
Posts: 85
Thank you, Sepreath and vuurrobin!
Man! This is very difficult!

Quote:
lazyprogramer, why do you need the temperature?

I wondered that the DS can read the temperatur, this was very surprising! So I wanted to know how to
code the reading of temperatur! I find it's still a funny small feature and I wanted to use this little feature
in a project. I'm from Germany and I did not finished school yet ,so sometimes it's hard to understand how to code
something...


Fri Dec 17, 2010 2:38 pm
Profile

Joined: Thu Dec 16, 2010 3:50 pm
Posts: 2
Some reading material for you:
Fixed point maths


Fri Dec 17, 2010 3:10 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 47 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
  Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.
Get devkitPro at SourceForge.net. Fast, secure and Free Open Source software downloads