View unanswered posts | View active topics It is currently Tue Nov 12, 2019 9:11 am






Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
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 Re: Do I need to have a NXT brick to run an NXT (LEGO brick?
Code:
#pragma config(Hubs,  S1, HTMotor,  none,     none,     none)
#pragma config(Sensor, S1,     ,               sensorI2CMuxController)
#pragma config(Motor,  mtr_S1_C1_1,     Right,         tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S1_C1_2,     Left,          tmotorTetrix, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#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;
      }



   }
}


Here is the error log I get when running the above code. Note that natural language is turned off:


File "C:\Users\aldas_000\Documents\Teleop.c" compiled on Jan 07 2015 10:34:57
*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.
**Info***:'spd1' is written but has no read references
**Info***:'spd2' is written but has no read references
**Info***:'spd3' is written but has no read references
**Info***:'spd4' is written but has no read references


I'll uninstall/reinstall RobotC and see if that fixes anything.


Wed Jan 07, 2015 12:37 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?
After reinstalling it, nothing has changed. I get the same errors.


Wed Jan 07, 2015 12:53 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?
I have tested your code in a fresh build of ROBOTC 4.27 and did not receive any errors; my guess is that one of the files has been corrupted or changed, and is causing these issues.

To resolve this issue, uninstall ROBOTC through the Windows Control panel. Once ROBOTC has been uninstalled, you will need to manually delete any remaining files in the ROBOTC directory (typically C:/Program Files (x86)/Robomatter Inc/ROBOTC Development 4.x). If you are using a building license file for your ROBOTC activation, make sure to copy the file to a safe location before deleting the files in the directory (it will have an .lfx extension, if applicable). Also, make sure any custom programs you have created are saved in a safe location to prevent them from being deleted accidentally.

Once the directory has been cleaned, download and reinstall a fresh copy of ROBOTC 4.27 from our downloads page: http://www.robotc.net/download/lego/

Reload the program in ROBOTC, make sure the Platform Type menu options are set correctly, and let us know if the issues persist.

_________________
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 1:26 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?
After I uninstall ROBOTC, the Robomatter Inc folder doesns't exist. It appears to be wiped from my computer. Could I install it again and then delete the directory and uninstall?


Wed Jan 07, 2015 2:20 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?
Alright, so I uninstalled ROBOTC. There were no remaining files, so I didn't really do anything with that. I just reinstalled it, and made sure not to compile anything with natural language on (and kept it off), and made sure everything was set up for the version I had. Now it seems to work fine, the JoystickDriver seems to work and all is well. Thank you all!


Thu Jan 08, 2015 1:56 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 20 posts ]  Go to page Previous  1, 2

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.