View unanswered posts | View active topics It is currently Fri Aug 01, 2014 5:24 am






Reply to topic  [ 5 posts ] 
In-Program Error 
Author Message
Moderator
Moderator

Joined: Thu Jan 03, 2013 5:10 pm
Posts: 198
Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Post In-Program Error
Hello,

As I was running some new code I made on the emulator, I received an error message ( type 59 ). This is the line of error:

p1.yposcu = round((float)((g*(time^2))+(p1.velosz*sinDegrees(p1.thetsz)*time)+p1.ypossz));

p1.yposcu is a short,
p1.thetsz is a short equal to 30,
p1.ypossz is a short equal to 10,
p1.velosz is a short equal to 5,
and time is a float.

g is a constant equal to -9.8.

It does not matter what time is. The error I get is 'real address range exception(59)'.

What went wrong?

Thanks in advance for helping.

-Coder A

_________________
I'm not a robot! I'm british! ~ quote from an asparagus
I am not a robot! I am a unicorn! ~ quote from a robot


Thu Feb 28, 2013 10:30 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3168
Location: Rotterdam, The Netherlands
Post Re: In-Program Error
How about you provide us with a piece of actual code that can reproduce this issue. Sometimes the error is actually on the line BEFORE the highlighted one.

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Mar 01, 2013 12:36 am
Profile WWW
Moderator
Moderator

Joined: Thu Jan 03, 2013 5:10 pm
Posts: 198
Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Post Re: In-Program Error
Here:

Code:
while(p1.xposcu>-1&&p1.xposcu<100&&p1.yposcu>-1)
   {
      time = time1[T1]/1000;
      p1.xposcu = round((float)((p1.velosz*cosDegrees(p1.thetsz)*time)+p1.xpossz));
      p1.yposcu = round((float)((g*(time^2))+(p1.velosz*sinDegrees(p1.thetsz)*time)+p1.ypossz));
      nxtSetPixel(p1.xposcu,p1.yposcu);
   }

_________________
I'm not a robot! I'm british! ~ quote from an asparagus
I am not a robot! I am a unicorn! ~ quote from a robot


Fri Mar 01, 2013 9:41 am
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: In-Program Error
Just as a heads up, x^y isn't x to the power y in C. It's a bitwise XOR operator.

_________________
sudo rm -rf /


Fri Mar 01, 2013 10:38 am
Profile
Moderator
Moderator

Joined: Thu Jan 03, 2013 5:10 pm
Posts: 198
Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Post Re: In-Program Error
Oh, thanks. That is probably the problem. Thanks!

_________________
I'm not a robot! I'm british! ~ quote from an asparagus
I am not a robot! I am a unicorn! ~ quote from a robot


Fri Mar 01, 2013 3:11 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

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 © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.