Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Number Variables Gone Bezerk! (http://www.chiefdelphi.com/forums/showthread.php?t=33959)

Jatheon4316 04-02-2005 08:25

Number Variables Gone Bezerk!
 
My team has run into a little difficulty.... :ahh:

Whenever we try to use floats, longs, doubles, or anything else besides integers...our robot does all kinds of weird things it shouldn't be doing...

As long as we use int's, our coding runs the way it should...however, it would be very nice if we didn't have to round everything of to an integer!

HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :eek:

Mike Betts 04-02-2005 08:45

Re: Number Variables Gone Bezerk!
 
Please read this thread.

prograid 04-02-2005 12:48

Re: Number Variables Gone Bezerk!
 
Quote:

Originally Posted by Mike Betts
Please read this thread.

That thread is about floatingpoint operations. I don't think it applies to longs and stuff.

In reply, to the first post, It may be possible that you are running out of memory because of using too many floats, longs, doubles, etc. Can you use chars? If not then something is really wrong, because your pwms are chars.

Jatheon4316 04-02-2005 13:08

Re: Number Variables Gone Bezerk!
 
When we tried to use ints (to print the joystick's x and y axis values onscreen) we had nothing but the default code and those few lines! ---Later though I realized that we were putting "%i" in the printf statements, only "%d"s are supported!

The other times we've had problems so far also have been with the default code and only a few extra variables...

Note: We're using the team robot from last year (2004) to test our coding on...could some kind of conflict (between 05 MPLAB+default code and the 2004 robot) be causing the trouble? The idea of doing trig functions and accurate autonomous navigation with only ints and chars is not very nice... :ahh:

Alan Anderson 04-02-2005 13:28

Re: Number Variables Gone Bezerk!
 
Quote:

Originally Posted by Jatheon4316
The idea of doing trig functions and accurate autonomous navigation with only ints and chars is not very nice... :ahh:

One word: CORDIC.


All times are GMT -5. The time now is 23:57.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi