My FTC team is having difficulty programming the Lego M motor using RobotC. We are using this motor to control our claw that picks up the rings in the 2012 game. However, we only have the functionality to fully open the claw (almost to the point of breaking) and to fully close it. We cannot figure out how to get the program right in order to have more control over the claw's functionality. Anyone know of a good reference we can look at for info on how to program this special type of motor. My team seems to think it more so designed for programming in LabView, but there must be a way to control it with RobotC. Please help!

Many Thanks!

Wed Nov 28, 2012 4:50 pm

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: Programming the LEGO m Motor with RobotC

The LEGO motors have built-in encoders. So assuming your claw is closed to start with and assuming you want to use the joystick to control it. Here is an example on how to do it. It's not the best code but it's simple.

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