ROBOTC.net forums
http://robotc.net/forums/

HELP PLEASE!!
http://robotc.net/forums/viewtopic.php?f=15&t=4497
Page 1 of 1

Author:  Marc [ Fri May 04, 2012 12:25 pm ]
Post subject:  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 941 times

Author:  magicode [ Fri May 04, 2012 12:38 pm ]
Post subject:  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.

Author:  miki [ Fri May 04, 2012 12:46 pm ]
Post subject:  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.

Author:  Marc [ Fri May 04, 2012 12:49 pm ]
Post subject:  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 903 times

Author:  magicode [ Fri May 04, 2012 1:28 pm ]
Post subject:  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?

Author:  Marc [ Tue May 08, 2012 11:48 am ]
Post subject:  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.

Author:  Coder A [ Thu Jan 03, 2013 7:16 pm ]
Post subject:  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.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/