View unanswered posts | View active topics It is currently Wed Aug 05, 2020 9:54 am






Reply to topic  [ 1 post ] 
NXT RCX Hybrid Help 
Author Message
Moderator
Moderator
User avatar

Joined: Tue Dec 21, 2010 1:38 pm
Posts: 24
Post NXT RCX Hybrid Help
I've finally been able to get my robot to go forward using a NXT brick and 2 RCX motors.
But how do I get my robot to go straight using a NXT brick, 2 RCX motors and 2 RCX rotation sensors?

Essentially, how do I implement things like motor encoder, and motors sync commands with the RCX rotation sensors and the 2 RCX motors using ROBOTC to get precise movements?

Below is a ROBOTC RCX Sample Program for the Rotation Sensor. However when I tried to download it to my NXT it gave me an error message, next to the "ClearSensorValue..."

So I erased "Clear" form "ClearSensorValue" and then I set "SensorValue(rotationSensorA)" equal to zero, and this finally allowed me to download the program to my NXT.

Yet, the robot still didn't go straight :/
Can anyone help me?


task main()
{

// This is what the Sample Program said originally,
ClearSensorValue(rotationSensorA);
ClearSensorValue(rotationSensorB);
//Which I later changed to:
//SensorValue(rotationSensorA) = 0;
//SensorValue(rotationSensorB) = 0;

while(SensorValue(rotationSensorA) < 320 && SensorValue(rotationSensorB) < 320)
{
motor[motorA] = 100;
motor[motorB] = 100;
}
}

_________________
Eric Smalls
About Me: http://www.stanford.edu/~esmalls/
My Projects: http://www.ericsmalls.com/p/my-projects.html


Wed Feb 23, 2011 3:16 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.