View unanswered posts | View active topics It is currently Sat Dec 20, 2014 5:45 am






Reply to topic  [ 7 posts ] 
HELP PLEASE!! 
Author Message
Rookie

Joined: Fri May 04, 2012 12:19 pm
Posts: 3
Post HELP PLEASE!!
My friends and I are working on a project for school and we keep on getting errors. Our goal is to make a robotic arm which does three things; Can turn around 360degrees have the arm go up and down and to make pincers open and close. But the problem is we can not get the robot to do all the things in a single program. We are beginners, by the way ha.
I attached the code if anyone could help it would be greatly appreciated :(. Thanks for your time.


"Mechanical.Arm.2A.Marc.Eli.Aaron.c" compiled on May 04 2012 11:20:21
**Error**:Duplicate definition for name 'BaseMotor'.
*Warning*:Unreferenced task 'BaseMotor'
**Error**:Duplicate definition for name 'ArmMotor'.
*Warning*:Unreferenced task 'ArmMotor'
**Error**:Duplicate definition for name 'PincerMotor'.
*Warning*:Unreferenced task 'PincerMotor'


Attachments:
Mechanical.Arm.2A.Marc.Eli.Aaron.c [1.58 KiB]
Downloaded 555 times
Fri May 04, 2012 12:25 pm
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: HELP PLEASE!!
You're using tasks in this program, which is used for multitasking. Read this and make sure you actually want to use multitasking. Otherwise, the error's you're getting are just a result of where you have your code. Move the 3 tasks you defined up before the main task, and you should be fine. I didn't go over it in detail though, so I don't know if you have any other problems in there.

_________________
sudo rm -rf /


Fri May 04, 2012 12:38 pm
Profile
Moderator
Moderator
User avatar

Joined: Thu Dec 22, 2011 7:42 am
Posts: 43
Post Re: HELP PLEASE!!
Hi Marc,

3 quick tips:
  • Declare task main() at the end of code source, after the other task declarations.
  • Second, You used the name BaseMotor in the pragma declaration. For the task name, declare another name like TaskBaseMotor for instance.
  • take time to read each error, one by one and try to understand them quietly ;-)

Best regards,
Miki.

_________________
Visit my project RainBot v0.11 on source forge, a 6 wheels robot featuring A* & Dijkstra's path finding, motors & sensors emulation, small font, fifo & sorted list libraries, using Xander's drivers for HT Compass, and documented with doxygen.


Fri May 04, 2012 12:46 pm
Profile
Rookie

Joined: Fri May 04, 2012 12:19 pm
Posts: 3
Post Re: HELP PLEASE!!
Is multi tasking the only way to be able to do 3 tasks in a single program??


EDIT:
We actually got it to compile but it would not do anything :(. We also edited the program a bit.




*Warning*:There are possible simultaneous variable memory access conflicts for
subroutine 'startMotor' called from multiple tasks 'taskArmMotor' and 'taskBaseMotor'
*Warning*:There are possible simultaneous variable memory access conflicts for
subroutine 'stopMotor' called from multiple tasks 'taskArmMotor' and 'taskBaseMotor'
*Warning*:There are possible simultaneous variable memory access conflicts for
subroutine 'untilEncoderCounts' called from multiple tasks 'taskArmMotor' and 'taskBaseMotor'
*Warning*:Unreferenced task 'taskPincerMotor'
*Warning*:Mismatched typedefs. Converting typedef 'tMotor' to typedef 'tSensors', value 'limitSwitch'
*Warning*:Unreferenced task 'taskArmMotor'
**Info***:There are possible simultaneous variable memory access conflicts for
subroutine 'untilEncoderCounts' called from multiple tasks 'taskArmMotor' and 'taskBaseMotor'
**Info***:There are possible simultaneous variable memory access conflicts for
subroutine 'startMotor' called from multiple tasks 'taskArmMotor' and 'taskBaseMotor'
**Info***:There are possible simultaneous variable memory access conflicts for
subroutine 'stopMotor' called from multiple tasks 'taskArmMotor' and 'taskBaseMotor'
*Warning*:Unreferenced task 'taskBaseMotor'
**Info***:There are possible simultaneous variable memory access conflicts for
subroutine 'untilEncoderCounts' called from multiple tasks 'taskArmMotor' and 'taskBaseMotor'
**Info***:There are possible simultaneous variable memory access conflicts for
subroutine 'startMotor' called from multiple tasks 'taskArmMotor' and 'taskBaseMotor'
**Info***:There are possible simultaneous variable memory access conflicts for
subroutine 'untilEncoderCounts' called from multiple tasks 'taskArmMotor' and 'taskBaseMotor'
**Info***:There are possible simultaneous variable memory access conflicts for
subroutine 'stopMotor' called from multiple tasks 'taskArmMotor' and 'taskBaseMotor'
**Info***:There are possible simultaneous variable memory access conflicts for
subroutine 'untilEncoderCounts' called from multiple tasks 'taskArmMotor' and 'taskBaseMotor'
**Info***:There are possible simultaneous variable memory access conflicts for
subroutine 'startMotor' called from multiple tasks 'taskArmMotor' and 'taskBaseMotor'
**Info***:There are possible simultaneous variable memory access conflicts for
subroutine 'untilEncoderCounts' called from multiple tasks 'taskArmMotor' and 'taskBaseMotor'
**Info***:There are possible simultaneous variable memory access conflicts for
subroutine 'stopMotor' called from multiple tasks 'taskArmMotor' and 'taskBaseMotor'


Attachments:
Mechanical.Arm.2A.Marc.Eli.Aaron.c [2.21 KiB]
Downloaded 545 times
Fri May 04, 2012 12:49 pm
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: HELP PLEASE!!
No, most things do not require multitasking. Did you read the post I linked to? What exactly do you want to do?

_________________
sudo rm -rf /


Fri May 04, 2012 1:28 pm
Profile
Rookie

Joined: Fri May 04, 2012 12:19 pm
Posts: 3
Post Re: HELP PLEASE!!
The goal is to have all the programs run simultaneously, so that we wont have to keep on opening and compiling different programs to do different things. And yes I did read it.


Tue May 08, 2012 11:48 am
Profile
Moderator
Moderator

Joined: Thu Jan 03, 2013 5:10 pm
Posts: 198
Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Post Re: HELP PLEASE!!
Magicode: I don't think that is the question he is asking.

Marc: Yes, the only way to do multiple things at once is to use tasks.

_________________
I'm not a robot! I'm british! ~ quote from an asparagus
I am not a robot! I am a unicorn! ~ quote from a robot


Thu Jan 03, 2013 7:16 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 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.