Include math function in BricxCC for NXT

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
userschneider
Posts: 3
Joined: 22 May 2012, 16:25

Include math function in BricxCC for NXT

Post by userschneider »

Hello, I habe a newbie question that you might laugh about. I wrote my first NXC program for NXT Mindstorms with BricxCC and wanted to use a math function like tan.
I get the error "ndefined Identifier tan" what tells me I habe to include math functions. But where do I get them? The help function of NXC tells about float atan ( float x ) but the example program ex_atan.nxc
does not work.

Can anyone give a hand?

Best regards, Uli
h-g-t
Posts: 552
Joined: 07 Jan 2011, 08:59
Location: Albania

Re: Include math function in BricxCC for NXT

Post by h-g-t »

atan is the arctangent, you need a similar program but just tan, not atan.
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
spillerrec
Posts: 358
Joined: 01 Oct 2010, 06:37
Location: Denmark
Contact:

Re: Include math function in BricxCC for NXT

Post by spillerrec »

Nearly all of the mathematical functions requires the enhanced firmware. So you have to make sure you are compiling for the enhanced firmware (which you are not) and that you have the enhanced firmware installed on your NXT. (Newer versions of BCC might auto detect your firmware and compile accordingly, but I'm not sure...)
My blog: http://spillerrec.dk/category/lego/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests