View unanswered posts | View active topics It is currently Fri Nov 22, 2019 5:45 am






Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Do I need to have a NXT brick to run an NXT (LEGO brick?) 
Author Message
Rookie

Joined: Sun Jan 04, 2015 8:47 pm
Posts: 23
Post Do I need to have a NXT brick to run an NXT (LEGO brick?)
I've watched a couple of videos on how to set up RobotC and all of them say to go to Robot->Platform Type->Legomindstorms and then choose an option called "Tetric + Matrix" or something along those lines. Then it sets their brick to a "NXT Brick" but not only do those options not show up for me, it also sets my brick to a "LEGO Brick" and I think this is the source of my problems.

These problems include controllers seeming to not register and a bunch more, but I just want to know if I can run a NXT, FTC robot with this "LEGO Brick" or if I have to switch to the NXT brick. And if so, how do I do that, as the options I've seen to change to it don't show up.


Sun Jan 04, 2015 8:56 pm
Profile
Professor
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 256
Post Re: Do I need to have a NXT brick to run an NXT (LEGO brick?
Just wondering, what version of ROBOTC are you using? Because the platform options that are displayed are different between version 3 and version 4.

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://bluechariotsoffire.com/.


Mon Jan 05, 2015 1:08 am
Profile
Rookie

Joined: Sun Jan 04, 2015 8:47 pm
Posts: 23
Post Re: Do I need to have a NXT brick to run an NXT (LEGO brick?
BurningLights wrote:
Just wondering, what version of ROBOTC are you using? Because the platform options that are displayed are different between version 3 and version 4.


The latest version, 4.27.


Mon Jan 05, 2015 12:31 pm
Profile
Professor
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 256
Post Re: Do I need to have a NXT brick to run an NXT (LEGO brick?
So, in version 4, for FTC robots there are actually two settings you need to select. The first is the actual platform type, which you need to set to MINDSTORMS NXT, which can be done by going in the menus to Robot->Platform Type->LEGO Mindstorms->LEGO Mindstorms NXT. Then, you need to enable external motor and servo controllers, which is done at Robot->Platform Type->External Motor/Servo Controllers.

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://bluechariotsoffire.com/.


Mon Jan 05, 2015 5:39 pm
Profile
Rookie

Joined: Sun Jan 04, 2015 8:47 pm
Posts: 23
Post Re: Do I need to have a NXT brick to run an NXT (LEGO brick?
And that's it? Everything should work?

I'm wondering because a fellow teammate trained me to use the program that is an older version, and nothing is lining up with my new version at home and I've had nothing but problems...


Mon Jan 05, 2015 9:39 pm
Profile
Novice

Joined: Tue Dec 16, 2014 10:25 am
Posts: 81
Post Re: Do I need to have a NXT brick to run an NXT (LEGO brick?
Yup if you use those options in robot C 4.27 it should fix your errors

_________________
Thanks!


Tue Jan 06, 2015 12:10 am
Profile
Rookie

Joined: Sun Jan 04, 2015 8:47 pm
Posts: 23
Post Re: Do I need to have a NXT brick to run an NXT (LEGO brick?
It's not required that you read my rant below, but thanks for the replies! It's nice to know the answer for future reference when I fix the other problems.

That's how I had it when I originally started to try and program my robot. But the problem was it wasn't accepting my user input from the controller. It worked for a sample program, but not for my program and I thought that it was because the "JoystickDriver.c" include wasn't being seen, as the text in the get joystick settings function was black.

And then today, I try to run a program and I get at least 40 errors all on the task main() section... definitely getting more than I asked for, I"m plagued with problems.


Tue Jan 06, 2015 12:18 am
Profile
Novice

Joined: Tue Dec 16, 2014 10:25 am
Posts: 81
Post Re: Do I need to have a NXT brick to run an NXT (LEGO brick?
Could you post your code? That would help to debug the program and fix all the errors.

_________________
Thanks!


Tue Jan 06, 2015 12:30 am
Profile
Rookie

Joined: Sun Jan 04, 2015 8:47 pm
Posts: 23
Post Re: Do I need to have a NXT brick to run an NXT (LEGO brick?
Absolutely. Please don't focus on the code itself, as it's not finished and I know it wouldn't work, (like I don't know how to add a header file, so what I would put in there I just put here to visualize it better) but I get errors all the same. I get errors on the task main() function with my programs and with sample programs.

Code:
#include "JoystickDriver.c"
//#include headerFuctions
task main()
{

int spd1 = 25;        //Press button, which chooses one of the 4 speeds for the 4 buttons.
int spd2 = 50;
int spd3 = 75;
int spd4 = 100;

while(true)
   {
      getJoystickSettings(joystick);
      if(joystick.joy1_y1 > 15)            //This block is for going forwards.
      {
         motor[Left] = 50;
      }
      else
      {
         motor[Left] = 0;
      }

      getJoystickSettings(joystick);
      if(joystick.joy1_y2 > 15)
      {
         motor[Right] = 50;
      }
      else
      {
         motor[Right] = 0;
      }
   //----------------------------------------------------------------------------------
      getJoystickSettings(joystick);
      if(joystick.joy1_y1 < -15)         //This block is for going in reverse.
      {
         motor[Left] = -50;
      }
      else
      {
         motor[Left] = 0;
      }
      getJoystickSettings(joystick);
      if(joystick.joy1_y2 < -15)
      {
         motor[Right] = -50;
      }
      else
      {
         motor[Right] = 0;
      }
   }
}


And This is the error log I get when I try to run the above program. I'm not sure if there is a way to clip it, so I'm forced to just paste it here -- there are a lot of errors:

File "C:\Users\aldas_000\Documents\Teleop.c" compiled on Jan 06 2015 14:34:59
*Warning*:Pre-processor string comparison found. This is a ROBOTC extension. Not supported by ANSI "C" Compilers.
*Warning*:Pre-processor string comparison found. This is a ROBOTC extension. Not supported by ANSI "C" Compilers.
*Warning*:Pre-processor string comparison found. This is a ROBOTC extension. Not supported by ANSI "C" Compilers.
*Warning*:Pre-processor string comparison found. This is a ROBOTC extension. Not supported by ANSI "C" Compilers.
*Warning*:Pre-processor string comparison found. This is a ROBOTC extension. Not supported by ANSI "C" Compilers.
*Warning*:Pre-processor string comparison found. This is a ROBOTC extension. Not supported by ANSI "C" Compilers.
**Error**:Expression does not fit parameter. Call to 'cCmdMessageRead'. Parameter: 'ubyte * pData' is 'tempBuffer' of type 'sbyte [18]'.
*Warning*:Pre-processor string comparison found. This is a ROBOTC extension. Not supported by ANSI "C" Compilers.
*Warning*:Symbol 'nxtDisplayTextLine' is 'deprecated' definition. There may be alternate symbol with equivalent functionality.
*Warning*:Symbol 'nxtDisplayCenteredTextLine' is 'deprecated' definition. There may be alternate symbol with equivalent functionality.
**Error**:Procedure call Parameters don't match declaration for 'OpenRead(TFileHandle & hFileHandle, TFileIOResult & nIoResult, char * pzFileName, short & nFileSize)'
**Error**:Procedure call Parameters don't match declaration for 'strcat(char * pToBuffer, char * pFromBuffer)'
*Warning*:Substituting similar variable 'stringDelete' for 'StringDelete'. Check spelling and letter case.
**Error**:Variable 'TJoystickAxis' declaration must be qualified with type. Type 'short' used.
**Error**:')' missing. Ummatched left parenthesis '('
**Error**:Expected->')'. Found 'rightJoystick'
**Error**:No body declared for procedure
**Error**:Expected->'}'. Found 'rightJoystick'
**Error**:Undefined variable 'rightJoystick'. 'short' assumed.
**Error**:Undefined variable 'JoyY2'. 'short' assumed.
**Error**:Expected->';'. Found ','
**Error**:Executable statements not valid in 'main' declaration block
**Error**:Unexpected ',' during parsing
**Error**:Undefined variable 'TJoystickAxis'. 'short' assumed.
**Error**:Expected->';'. Found 'leftJoystick'
**Error**:Undefined variable 'leftJoystick'. 'short' assumed.
**Error**:Undefined variable 'JoyY1'. 'short' assumed.
**Error**:Missing ';' before ')'
**Error**:Unexpected ')' during parsing
*Warning*:Meaningless statement -- no code generated
**Error**:Undefined variable 'JoyX1'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'JoyX2'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:Variable 'TJoystickAxis' declaration must be qualified with type. Type 'short' used.
**Error**:')' missing. Ummatched left parenthesis '('
**Error**:Expected->')'. Found 'verticalJoystick'
**Error**:No body declared for procedure
**Error**:Expected->'}'. Found 'verticalJoystick'
**Error**:Undefined variable 'verticalJoystick'. 'short' assumed.
**Error**:Expected->';'. Found ','
**Error**:Executable statements not valid in 'main' declaration block
**Error**:Unexpected ',' during parsing
**Error**:Expected->';'. Found 'horizontalJoystick'
**Error**:Undefined variable 'horizontalJoystick'. 'short' assumed.
**Error**:Duplicate variable declaration of 'threshold'
**Error**:Variable 'threshold' has been previously defined with a different value.
**Error**:Missing ';' before ')'
**Error**:Unexpected ')' during parsing
*Warning*:Meaningless statement -- no code generated
**Error**:Duplicate definition for task 'main'.
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:Variable 'TJoystickButtons' declaration must be qualified with type. Type 'short' used.
**Error**:')' missing. Ummatched left parenthesis '('
**Error**:Expected->')'. Found 'upButton'
**Error**:No body declared for procedure
**Error**:Expected->'}'. Found 'upButton'
**Error**:Undefined variable 'upButton'. 'short' assumed.
**Error**:Undefined variable 'Btn5'. 'short' assumed.
**Error**:Expected->';'. Found ','
**Error**:Executable statements not valid in 'main' declaration block
**Error**:Unexpected ',' during parsing
**Error**:Undefined variable 'TJoystickButtons'. 'short' assumed.
**Error**:Expected->';'. Found 'downButton'
**Error**:Undefined variable 'downButton'. 'short' assumed.
**Error**:Undefined variable 'Btn7'. 'short' assumed.
**Error**:Missing ';' before ')'
**Error**:Unexpected ')' during parsing
*Warning*:Meaningless statement -- no code generated
**Error**:Duplicate definition for task 'main'.
**Error**:Undefined variable 'Btn1'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'Btn2'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'Btn3'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'Btn4'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'Btn6'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'Btn8'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'Btn9'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'Btn10'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'Pov0'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'Pov1'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'Pov2'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'Pov3'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'Pov4'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'Pov5'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'Pov6'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'Pov7'. 'short' assumed.
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:'case' statement expression must have constant value
**Error**:Undefined variable 'armMotorPort'. 'short' assumed.
**Info***:Include file 'C:\Users\aldas_000\Documents\JoystickDriver.c' has already been opened.
**FATAL**:Too many errors. Compilation aborted


Not sure if it means anything, but the "joystick" in getJoystickSettings doesn't change color like it's being recognized. I believe it should turn blue, as I've seen it in tutorial videos. Not sure if it means anything, but I think it's why my joysticks aren't working.

And the include pragma for the JoystickDriver has a grey X by it, and the error log says "**Info***:Include file 'C:\Users\aldas_000\Documents\JoystickDriver.c' has already been opened." as you can see in the log. Does that mean that that file is included automatically? Is that a feature of 4.0?

I have a feeling I messed a lot of stuff up here, and I hope someone can help me get it sorted out, I really just want to continue to learn to program. Thanks in advance!


Tue Jan 06, 2015 4:45 pm
Profile
Rookie

Joined: Sun Jan 04, 2015 8:47 pm
Posts: 23
Post Re: Do I need to have a NXT brick to run an NXT (LEGO brick?
Just realized I didn't set my motors and stuff up again when I opened up that program. So I did that, and it gave me warnings on the two lines of pragma where I define my drive motors. But still an error in the task main().


Tue Jan 06, 2015 4:48 pm
Profile
Professor
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 256
Post Re: Do I need to have a NXT brick to run an NXT (LEGO brick?
It seems like maybe you don't have a valid license activation for ROBOTC. At least, I seem to recall those kinds of errors when that was the case. Can you verify that you do indeed have an activate ROBOTC 4 license? Oh, and there's a notice at the top of the start page when I open ROBOTC 4 that says their licensing system is currently down, so I don't know if that maybe is contributing to your issues?? :?

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://bluechariotsoffire.com/.


Tue Jan 06, 2015 11:35 pm
Profile
Novice

Joined: Tue Dec 16, 2014 10:25 am
Posts: 81
Post Re: Do I need to have a NXT brick to run an NXT (LEGO brick?
One thing I can quickly add is I think you have natural language on which includes joystick.c automatically. If you disable that it should clear some errors up. (If I remember correctly its next to the External Motors check box) if I have time later I'll put your code into robotc and try to find out what's causing the errors

_________________
Thanks!


Wed Jan 07, 2015 12:06 am
Profile
Rookie

Joined: Sun Jan 04, 2015 8:47 pm
Posts: 23
Post Re: Do I need to have a NXT brick to run an NXT (LEGO brick?
I just have a trial license at the moment, I didn't buy anything. But should that matter? And I'll try to turn natural language off and see if that does anything.


Wed Jan 07, 2015 11:57 am
Profile
Rookie

Joined: Sun Jan 04, 2015 8:47 pm
Posts: 23
Post Re: Do I need to have a NXT brick to run an NXT (LEGO brick?
I turned off natural language, and it got rid of the error on the task main(). So I commented out the include for JoystickDriver.C because you said it was included but then it gave all of my functions errors. I got errors like "**Error**:Undefined procedure 'getJoystickSettings'." But the program still wouldn't download.

The ints I had had a gray X, and said "**Info***:'spd3' is written but has no read references" but I don't think that's a big deal.

For every if statement is give a warning: *Warning*:Meaningless statement -- no code generated

After I uncommented the JoystickDriver.c include, I got like 6 errors saying: *Warning*:Pre-processor string comparison found. This is a ROBOTC extension. Not supported by ANSI "C" Compilers.

and some others that are similar to: **Error**:Expression does not fit parameter. Call to 'cCmdMessageRead'. Parameter: 'ubyte * pData' is 'tempBuffer' of type 'sbyte [18]'.

And: **Error**:Procedure call Parameters don't match declaration for 'strcat(char * pToBuffer, char * pFromBuffer)'

But it doesn't actually show any errors in the code, like there are no red X's. But they do show up in the error log.

I'm extremely confused, if the JoystickDriver is included, why do I still need it in the program or else I get errors. Do I have to do something else in order to not work in natural language anymore?


Wed Jan 07, 2015 12:06 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 722
Post Re: Do I need to have a NXT brick to run an NXT (LEGO brick?
Please post the entirety of your code, including the #pragma statements and the #include lines. You may also want to perform a fresh uninstall/reinstall of ROBOTC, as the joystick driver file may have been changed or corrupted accidentally.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our updated help documentation and the ROBOTC Forums.


Wed Jan 07, 2015 12:23 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 20 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 2 guests


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.