trying to program a hold when lifting arm

my kids are pretty new to programing and they are having trouble with their arm on their bot. the arm won’t stay raised unless they hold the button down on the remote continuously. is possible to add in extra code to tell the bot to keep the arm raised after they let the button go? they are using easyc to program. I don’t know enough about this to help them…

I don’t know EasyC unfortunately but I know both Modkit and ROBOTC have this function so I am sure it is in EasyC too.

what is the function in robotc? perhaps I can figure it out from there.

MoveMotor will o the job. You have to specify how much and the power level

In ROBOTC you have to set the motor mode using:

setMotorBrake(motorName, motorHold);

for each motor that you want in brake mode.

Then use one of the movement commands to move the motor (setMotor, setMotorTarget etc.)
The internal PID of the motor will hold it in the last place it ended up unless you tell it to move.

How do you do it in mod kit? We have the motor set as not with one button up and one down, so when it goes up the weight brings it back down

In Modkit there is a block called Holding or similar. Set it to on in your program.

in easyc we have set motor degrees and set motor rotations. will either of those work? does anybody else using easyc know?

Ok. we tried to use the set motor degrees button inside an if then loop. The arm will raise up now and stay but we can’t get it back down.Here is what we have so far. We have no idea what we are doing…

easyc file.JPG

Are you able to use one of the free languages (Modkit or ROBOTC) as most people (me included) can provide better help with these. Or are you comitted to EasyC?

I’ve had a quick look at some tutorial videos for EasyC V5 and I haven’t seen a motor hold equivalent but ot must be there somewhere!

I think we are committed to easyc because I cannot install new software on our laptops here at school, only IT admin people can. I’m pretty sure easyc is the only software the county purchased.

My question is in mod kit, how do you program the flex robot arm? It is setup as a motor but when the arm goes up it just falls down. How do you get it to hold.

In the blocks part, under the motor in question put a When Start block and attach to that a Set Motor Holding to On block, thats it.