View unanswered posts | View active topics It is currently Tue Jan 15, 2019 9:21 pm






Reply to topic  [ 14 posts ] 
IRSeeker code help please 
Author Message
Rookie

Joined: Wed Jan 14, 2015 7:13 pm
Posts: 28
Post IRSeeker code help please
I have been trying to program an IS sensor but every code that came up but none worked :evil: can some one give me an example code for 4.26-4.27? I would like it before the 24th of this month because thats the ftc championship for my league.


Thu Jan 15, 2015 11:25 am
Profile
Professor
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 256
Post Re: IRSeeker code help please
There's some sample programs in the NXT\3rd Party Driver Library\examples directory. Just choose Open Sample Program from the File menu in ROBOTC. Also, to make the sample programs work, you might have to tell ROBOTC where to find the drivers. Simply go to View->Preferences->Detailed Preferences. Choose the Compiler tab, then the Include Directories sub-tab. Click on the browse button next to the first textbox and select C:\Program Files (x86)\Robomatter Inc\ROBOTC Development Environment 4.X\Sample Programs\NXT\3rd Party Driver Library\include.

_________________
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/.


Thu Jan 15, 2015 2:18 pm
Profile
Rookie

Joined: Wed Jan 14, 2015 7:13 pm
Posts: 28
Post Re: IRSeeker code help please
Thanks :P code green


Thu Jan 15, 2015 3:02 pm
Profile
Rookie

Joined: Wed Jan 14, 2015 7:13 pm
Posts: 28
Post Re: IRSeeker code help please
I found the example code but there were a "few" errors

code RED

the issues were:
**Severe*:Couldn't open '#include' file 'hitechnic-irseeker-v2.h'
**Error**:Undefined variable 'tHTIRS2'. 'short' assumed.
**Error**:Expected->';'. Found 'irSeeker'
**Error**:Undefined variable 'irSeeker'. 'short' assumed.
*Warning*:Meaningless statement -- no code generated
**Error**:Undefined procedure 'initSensor'.
**Error**:'irSeeker' is not a reference to a 'struct'
**Error**:')' missing. Ummatched left parenthesis '('
**Error**:Expected->')'. Found 'mode'
**Error**:Undefined variable 'mode'. 'short' assumed.
**Error**:Undefined variable 'DSP_1200'. 'short' assumed.
**Error**:Missing ';' before ')'
**Error**:Unexpected ')' during parsing
*Warning*:Meaningless statement. Did you mean '=' instead of '=='?
**Error**:Unexpected 'else'. Ignored.
**Error**:Unexpected 'displayTextLine' during parsing
*Warning*:')' exepected before before ','. Automatically inserted.
**Error**:Expected->';'. Found ','
**Error**:Unexpected ',' during parsing
**Error**:Unexpected ' DC 600' during parsing
**Error**:Unexpected ')' during parsing
**Error**:Undefined procedure 'getXbuttonValue'.
**Error**:Undefined variable 'xButtonEnter'. 'short' assumed.
**Error**:'irSeeker' is not a reference to a 'struct'
**Error**:Expected->';'. Found 'mode'
**Error**:')' missing. Ummatched left parenthesis '('
**Error**:Expected->')'. Found 'mode'
**Error**:Missing ';' before ')'
**Error**:Unexpected ')' during parsing
**Error**:Unexpected '?' during parsing
*Warning*:Meaningless statement -- no code generated
*Warning*:Meaningless statement. Did you mean '=' instead of '=='?
**Error**:Undefined procedure 'readSensor'.
**Error**:'irSeeker' is not a reference to a 'struct'
**Error**:')' missing. Ummatched left parenthesis '('
**Error**:Expected->')'. Found 'dcDirection'
**Error**:Expected->';'. Found 'dcDirection'
**Error**:Undefined variable 'dcDirection'. 'short' assumed.
**Error**:Expected->';'. Found ','
**Error**:Unexpected ',' during parsing
**Error**:Expected->';'. Found 'acDirection'
**Error**:Undefined variable 'acDirection'. 'short' assumed.
**Error**:Expected->';'. Found 'enhDirection'
**Error**:Undefined variable 'enhDirection'. 'short' assumed.
**Error**:Missing ';' before ')'
**Error**:Unexpected ')' during parsing
*Warning*:Meaningless statement -- no code generated
**Error**:'irSeeker' is not a reference to a 'struct'
**Error**:')' missing. Ummatched left parenthesis '('
**Error**:Expected->')'. Found 'dcValues'
**Error**:Expected->';'. Found 'dcValues'
**Error**:Undefined variable 'dcValues'. 'short' assumed.
**Error**:LValue for '[]' operator must be a pointer
**Error**:'[]' operator requires pointer value on left hand side [2].
**Error**:Expected->';'. Found ','
**Error**:Unexpected ',' during parsing
**Error**:Expected->';'. Found 'acValues'
**Error**:Undefined variable 'acValues'. 'short' assumed.
**Error**:Missing ';' before ')'
**Error**:Unexpected ')' during parsing
*Warning*:Meaningless statement -- no code generated
**Error**:'irSeeker' is not a reference to a 'struct'
**Error**:')' missing. Ummatched left parenthesis '('
**Error**:Expected->')'. Found 'dcValues'
**Error**:Expected->';'. Found 'dcValues'
**Error**:LValue for '[]' operator must be a pointer
**Error**:'[]' operator requires pointer value on left hand side [2].
**Error**:Expected->';'. Found ','
**Error**:Unexpected ',' during parsing
**Error**:Expected->';'. Found 'acValues'
**Error**:Missing ';' before ')'
**Error**:Unexpected ')' during parsing
*Warning*:Meaningless statement -- no code generated
**Error**:'irSeeker' is not a reference to a 'struct'
**Error**:')' missing. Ummatched left parenthesis '('
**Error**:Expected->')'. Found 'dcValues'
**Error**:Expected->';'. Found 'dcValues'
**Error**:LValue for '[]' operator must be a pointer
**Error**:'[]' operator requires pointer value on left hand side [2].
**Error**:Expected->';'. Found ','
**Error**:Unexpected ',' during parsing
**Error**:Expected->';'. Found 'acValues'
**Error**:Expected->';'. Found 'enhStrength'
**Error**:Undefined variable 'enhStrength'. 'short' assumed.
**Error**:Missing ';' before ')'
**Error**:Unexpected ')' during parsing
*Warning*:Meaningless statement -- no code generated
**Error**:'irSeeker' is not a reference to a 'struct'
**Error**:')' missing. Ummatched left parenthesis '('
**Error**:Expected->')'. Found 'dcValues'
**Error**:Expected->';'. Found 'dcValues'
**Error**:LValue for '[]' operator must be a pointer
**Error**:'[]' operator requires pointer value on left hand side [2].
**Error**:Expected->';'. Found ','
**Error**:Unexpected ',' during parsing
**Error**:Expected->';'. Found 'acValues'
**Error**:Missing ';' before ')'
**Error**:Unexpected ')' during parsing
*Warning*:Meaningless statement -- no code generated
**Error**:'irSeeker' is not a reference to a 'struct'
**Error**:')' missing. Ummatched left parenthesis '('
**Error**:Expected->')'. Found 'dcValues'
**Error**:Expected->';'. Found 'dcValues'
**Error**:LValue for '[]' operator must be a pointer
**Error**:'[]' operator requires pointer value on left hand side [2].
**Error**:Expected->';'. Found ','
**Error**:Unexpected ',' during parsing
**Error**:Expected->';'. Found 'acValues'
**Error**:Missing ';' before ')'
**Error**:Unexpected ')' during parsing
*Warning*:Meaningless statement -- no code generated
**FATAL**:Too many errors. Compilation aborted


Fri Jan 16, 2015 1:00 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1523
Post Re: IRSeeker code help please
Your main problem is this error:
Code:
**Severe*:Couldn't open '#include' file 'hitechnic-irseeker-v2.h'

This means the compiler cannot find Xander's IR seeker driver. I'd bet if you fix this, all other errors will go away.
You should be able to find Xander's drivers at:
c:\Program Files (x86)\Robomatter Inc\ROBOTC Development Environment\Sample Programs\NXT\3rd Party Sensor Drivers\drivers for RobotC 3.x
and
c:\Program Files (x86)\Robomatter Inc\ROBOTC Development Environment 4.X\Sample Programs\NXT\3rd Party Driver Library\include for RobotC 4.x


Fri Jan 16, 2015 3:57 pm
Profile
Rookie

Joined: Wed Jan 14, 2015 7:13 pm
Posts: 28
Post Re: IRSeeker code help please
well, I got everything set up so the errors will go away and now the program crashes when I compile the sample!
what does RobotC have against me?!

code red


Sun Jan 18, 2015 5:03 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1523
Post Re: IRSeeker code help please
JAYPD wrote:
well, I got everything set up so the errors will go away and now the program crashes when I compile the sample!
what does RobotC have against me?!

code red

What do you mean by "the program crashes"? Did you have a compiler error or are you saying RobotC compiler crashed? Would you post the code that you have trouble with?


Sun Jan 18, 2015 5:25 pm
Profile
Rookie

Joined: Wed Jan 14, 2015 7:13 pm
Posts: 28
Post Re: IRSeeker code help please
I mean it says "ROBOTC integrated Developement has stopped working"


Sun Jan 18, 2015 5:33 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1523
Post Re: IRSeeker code help please
Did you try again and it crashed again or was it just one time? What about rebooting your computer and try again? Would you post the code that caused the issue?


Sun Jan 18, 2015 5:42 pm
Profile
Rookie

Joined: Wed Jan 14, 2015 7:13 pm
Posts: 28
Post Re: IRSeeker code help please
MHTS wrote:
Did you try again and it crashed again or was it just one time? What about rebooting your computer and try again? Would you post the code that caused the issue?


every time since friday


Sun Jan 18, 2015 5:47 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1523
Post Re: IRSeeker code help please
Did RobotC crash when you just start it up or it crashed when you compiled the code? If RobotC wasn't crashing when it starts up, you may want to click the "View" menu and click "Delete All registry values". Then close RobotC and starts it up again. See if this fixed the crashing problem.


Sun Jan 18, 2015 5:57 pm
Profile
Rookie

Joined: Wed Jan 14, 2015 7:13 pm
Posts: 28
Post Re: IRSeeker code help please
Do I need uninstall and re-install?


Sun Jan 18, 2015 5:59 pm
Profile
Rookie

Joined: Wed Jan 14, 2015 7:13 pm
Posts: 28
Post Re: IRSeeker code help please
MHTS wrote:
Did RobotC crash when you just start it up or it crashed when you compiled the code? If RobotC wasn't crashing when it starts up, you may want to click the "View" menu and click "Delete All registry values". Then close RobotC and starts it up again. See if this fixed the crashing problem.


it crashes when I load the file


Sun Jan 18, 2015 6:00 pm
Profile
Rookie

Joined: Wed Jan 14, 2015 7:13 pm
Posts: 28
Post Re: IRSeeker code help please
IT WORKS! thanks so much, now I just need to make a tetrix bot follow the IR beacon as autonomous in VW


Sun Jan 18, 2015 6:06 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 14 posts ] 

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.