controlMotor

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

controlMotor

Postby celanba » Thu May 15, 2014 8:53 am

Hey everyone,
I'm wondering if there is any way to use the "old" NXT version of .controlMotor for direct motor control?

In general I'm finding it increasingly had to access the raw values of sensors and actuators in this new framework. Is this on purpose or am I missing something? (also, if it IS on purpose - why?)

Right now Im doing something like this to make my robot work with direct motor-control. I know it's not pwetty...

Code: Select all
final EV3Port portA = new EV3Port("Dribble Wheel", EV3Port.MOTOR_PORT, 0);
final TachoMotorPort dribblingWheel = portA.open(TachoMotorPort.class);
celanba
New User
 
Posts: 16
Joined: Thu Feb 13, 2014 8:55 am

Re: controlMotor

Postby lawrie » Thu May 15, 2014 10:03 am

You can do:

Code: Select all
final TachoMotorPort dribblingWheel = MotorPort.A.open(TachoMotorPort.class);
lawrie
leJOS Team Member
 
Posts: 922
Joined: Mon Feb 05, 2007 1:27 pm

Re: controlMotor

Postby celanba » Thu May 15, 2014 10:42 am

Awesome. This was exactly what I was hoping for. Thanks a bunch :)
celanba
New User
 
Posts: 16
Joined: Thu Feb 13, 2014 8:55 am

Re: controlMotor

Postby gloomyandy » Thu May 15, 2014 8:05 pm

Why not simply use the NXTMotor class? What is it that you are trying to do and why doesn't the NXTMotor class work for you?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4084
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: controlMotor

Postby gloomyandy » Thu May 15, 2014 8:15 pm

In general sensors on the EV3 are rather more complex than on the NXT, so access to them tends to need to be more controlled and require much more complex lower level classes (so we need different classes for each of the sensor types rather than a single SensorPort class like we had for the NXT. What is it that you are trying to do? What is it that you don't like about the current sensor framework? If you don't provide feedback we won't be aware of any problems.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4084
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: controlMotor

Postby celanba » Mon Jun 02, 2014 2:11 pm

I was sure I had set the thread to notify me when it was update. Better late then never, I guess.
The short answer is: I didnt think about using a class called NXTMotor for controlling my EV3 motors. You're completely correct. I've changed my code to use NXTMotor instead.
Thanks :)
celanba
New User
 
Posts: 16
Joined: Thu Feb 13, 2014 8:55 am


Return to EV3 Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff