View unanswered posts | View active topics It is currently Wed Aug 27, 2014 11:29 pm






Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Lego motors 
Author Message
Rookie

Joined: Tue Jan 20, 2009 5:06 pm
Posts: 10
Post Lego motors
How can I connect lego motors to the NXT/hightechnic motor controller? Also, how do I use them in code? Are they like regular motors? I've been searching everywhere, but I can't find an answer...


Thu Feb 12, 2009 4:35 pm
Profile
Novice

Joined: Tue Jan 13, 2009 5:22 pm
Posts: 72
Location: USA, Pennsylvania
Post Re: Lego motors
You can't if I know what you are talking about...Tetrix 12 DC motors instead of your Lego motors.

_________________
We need a Linux Version!


Thu Feb 12, 2009 4:53 pm
Profile WWW
Rookie

Joined: Tue Jan 20, 2009 5:06 pm
Posts: 10
Post Re: Lego motors
They're orange and different shades of gray, they look kind of like the tip of a crane.


Thu Feb 12, 2009 4:57 pm
Profile
Novice

Joined: Tue Jan 13, 2009 5:22 pm
Posts: 72
Location: USA, Pennsylvania
Post Re: Lego motors
Can you send a link to the page where you bought them. You can't use it what I believe.

_________________
We need a Linux Version!


Thu Feb 12, 2009 5:06 pm
Profile WWW
Novice

Joined: Tue Jan 13, 2009 5:22 pm
Posts: 72
Location: USA, Pennsylvania
Post Re: Lego motors
Probably what you have bought is this http://www.hitechnic.com/index.html?lang=en-us&target=d14.html
The first one!
This should be in another forum I believe.

_________________
We need a Linux Version!


Thu Feb 12, 2009 5:10 pm
Profile WWW
Rookie

Joined: Tue Jan 20, 2009 5:06 pm
Posts: 10
Post Re: Lego motors
We have those electronics, but the controllers had a black covering.


Thu Feb 12, 2009 5:16 pm
Profile
Novice

Joined: Tue Jan 13, 2009 5:22 pm
Posts: 72
Location: USA, Pennsylvania
Post Re: Lego motors
It's only for the Tetrix motor!! as I said.

_________________
We need a Linux Version!


Thu Feb 12, 2009 5:20 pm
Profile WWW
Rookie

Joined: Tue Jan 20, 2009 5:06 pm
Posts: 10
Post Re: Lego motors
So the lego motors definitely cannot be used with a hightechnic motor controller on plugged in directly to the NXT?


Thu Feb 12, 2009 5:22 pm
Profile
Novice

Joined: Tue Jan 13, 2009 5:22 pm
Posts: 72
Location: USA, Pennsylvania
Post Re: Lego motors
No but why don't you use the other 3 ports on the NXT

_________________
We need a Linux Version!


Thu Feb 12, 2009 5:24 pm
Profile WWW
Rookie

Joined: Tue Jan 20, 2009 5:06 pm
Posts: 10
Post Re: Lego motors
That's my question; how do you use them?


Thu Feb 12, 2009 5:25 pm
Profile
Novice

Joined: Tue Jan 13, 2009 5:22 pm
Posts: 72
Location: USA, Pennsylvania
Post Re: Lego motors
You have to activate it in the motor and sensor setup then copy this code.
Quote:
task main()
{
while(true)
{
motor[motorD] = joystick.joy1_y1;
motor[motorE] = joystick.joy1_y2;
}
}

_________________
We need a Linux Version!


Thu Feb 12, 2009 5:33 pm
Profile WWW
Rookie

Joined: Tue Jan 20, 2009 5:06 pm
Posts: 10
Post Re: Lego motors
So, you use Lego motors like regular motors in code? Do you configure them the same way? Because I tried that and it's not working.


Thu Feb 12, 2009 5:35 pm
Profile
Novice

Joined: Tue Jan 13, 2009 5:22 pm
Posts: 72
Location: USA, Pennsylvania
Post Re: Lego motors
Motor controller on the sensor one (servo on the motor controller)
Check battery!


Quote:
#pragma config(Hubs, S1, HTMotor, HTServo, none, none)
#pragma config(Motor, mtr_S1_C1_1, motorD, tmotorNormal, PIDControl)
#pragma config(Motor, mtr_S1_C1_2, motorE, tmotorNormal, PIDControl)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

task main()
{

motor[motorD] = 100;
motor[motorE] = 100;
wait1Msec(1000);

motor[motorD] = -50;
motor[motorE] = -50;
wait1Msec(1000);

}

_________________
We need a Linux Version!


Thu Feb 12, 2009 5:39 pm
Profile WWW
Novice

Joined: Tue Jan 13, 2009 5:22 pm
Posts: 72
Location: USA, Pennsylvania
Post Re: Lego motors
Sorry for my sample code here is one that makes the motors A B C on the NXT brick to run
Quote:
#pragma config(Motor, motorA, , tmotorNormal, PIDControl)
#pragma config(Motor, motorB, , tmotorNormal, PIDControl)
#pragma config(Motor, motorC, , tmotorNormal, PIDControl)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

task main()
{
motor[motorA] = 100;//running motor A on full power
motor[motorB] = 100;//running motor A on full power
motor[motorC] = 100;//running motor A on full power
wait1Msec(1000)//take time running motor A, B, and C on full power for 1 second
}
//ends the program

_________________
We need a Linux Version!


Thu Feb 12, 2009 5:57 pm
Profile WWW
Novice

Joined: Fri Oct 24, 2008 8:58 am
Posts: 87
Post Re: Lego motors
FYI there are lots of samples in the sample code directory that use the NXT motors.

Also I've noticed alot of people are posting code with PIDControl turned on. I guess that's the default.
My personal experience is that this causes more wackiness than its worth. At least start with it OFF then turn it back on when you need it.

I know the great RobotC folks probably spent alot of sweat, tears and blood getting those things tuned, but I haven't had a single instance yet where they actually worked reliably. But it could just be me...


Fri Feb 13, 2009 10:05 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 20 posts ]  Go to page 1, 2  Next

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.