can somebody please help me it's my first time using the IR seeker sensor. I'm trying to use Xander's 3rd party sensors but the #include file gives me errors when I compile it. I'm not sure what is wrong. could someone please help me?

Joined: Thu Jan 03, 2013 5:10 pmPosts: 199Location: The plateau north of the Ohio River Valley, also known as Cave Country.

Re: IR seeker #include file not locating

Something that could be wrong is the name of the include file. Let's say you had the Dexter Industries IMU. The include file I'm told to use is "drivers/dexterind-imu.h", but that gets me an error. I changed it to "dexterind-imu.h" and it worked. It could be something as simple as that.

_________________I'm not a robot! I'm british! ~ quote from an asparagusI am not a robot! I am a unicorn! ~ quote from a robot

Tue Feb 19, 2013 3:11 pm

hrazo6332

Rookie

Joined: Sun Feb 17, 2013 11:27 pmPosts: 7

Re: IR seeker #include file not locating

I got it working but now it says there is a duplicate definition for task 'main'. why is it saying that?

Tue Feb 19, 2013 6:32 pm

Coder A

Moderator

Joined: Thu Jan 03, 2013 5:10 pmPosts: 199Location: The plateau north of the Ohio River Valley, also known as Cave Country.

Re: IR seeker #include file not locating

Would you mind to copy and paste the code so we can see? I've had that problem before and I'm sure I can fix it if you show me the code.

_________________I'm not a robot! I'm british! ~ quote from an asparagusI am not a robot! I am a unicorn! ~ quote from a robot

This is going to give you the same issues as before; only the motor[ringlift] = 10; and wait10Msec(200); commands will run repeatedly. To ensure that the entire program gets looped, make sure you place all of the code you want to run inside of the { and } of the 'while(true)' loop.

You can use ROBOTC's autoformat tool to automatically indent the code, which should make it a little bit easier to determine where the braces are (fourth icon from the left, the one that has the purple sparkles around it).

I tried that out but the whole code gets highlighted. I'm not sure if that is what you meant. When I try it on my robot it responds but only the ring lift motor moves and the only way to stop it is to stop the whole program. is there I way I could replace the timing for the rotation statement instead?

Wed Feb 20, 2013 6:25 pm

l0jec

Expert

Joined: Mon Oct 27, 2008 9:59 pmPosts: 139

Re: IR seeker #include file not locating

As JohnWatson said, your code is stuck in the while(true) loop and never executes any statements beyond that.

Code:

while (true) { motor[ringlift] = 10;

wait10Msec(200); }

This while loop will never end; your code is stuck executing the two statements inside forever. This matches the behavior you describe.

This appears to be an autonomous routine to me, so there is no need for the while(true) loop in your code best I can tell. Simply remove it like below:

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum