View unanswered posts | View active topics It is currently Thu Nov 27, 2014 9:20 am






Reply to topic  [ 2 posts ] 
sync robot C 1.0 
Author Message
Rookie

Joined: Fri Sep 21, 2007 12:03 pm
Posts: 1
Location: Pittsburgh
Post sync robot C 1.0
do you have a program to sync robot nxt motors for robot c version 1.0 :?:

thx

_________________
Aim for the roof and land on the ground aim for the stars and land on the roof


Mon Sep 24, 2007 12:16 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post 
Here is my sample program for syncing two motors together.

Also, RobotC 1.07 is available to download from the forum. It has some bug fixes and a few added functions.
viewtopic.php?t=217

Good Luck B-)


task main()
{

nSyncedMotors = synchAB; // Motor ‘B’ is slaved to motor ‘A’
nSyncedTurnRatio = 100; // Move in a straight line
nMotorEncoder[motorA] = 0;
motor[motorA] = 100;

while (true)
{
nxtDisplayTextLine(2,"Enc A=%d", nMotorEncoder[motorA]);
nxtDisplayTextLine(3,"Enc B=%d", nMotorEncoder[motorB]);
}

}

_________________
Mmmm Legos B-)

My Robot Projects:
http://www.freewebs.com/robotprojects/


Tue Sep 25, 2007 12:33 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 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.