Re: MotCont example?

89 views
Skip to first unread message

Marcus Wanner

unread,
Apr 19, 2013, 11:31:53 AM4/19/13
to nxt-p...@googlegroups.com
On Wed, Apr 17, 2013 at 08:04:59AM -0700, PtubbyTaylor wrote:
> I was wondering if anyone has some MotCont code they could share with
> me. I'm trying to run two motors simultaneously in opposite
> directions, for an arbitrary number of degrees. If anyone has some
> code that could get me started, that would be great.

This is off the top of my head and untested, but it should do the trick:

import nxt
b = nxt.find_one_brick()
m = nxt.motcont.MotCont(b)
m.cmd(nxt.PORT_A, 70, 360)
m.cmd(nxt.PORT_B, -70, 360)

See motcont.py or the help() docstrings for more info.

> I'm not exactly sure how to get the MotorControl.rxe file on, should I
> follow the instructions on their website
> http://www.mindstorms.rwth-aachen.de/trac/wiki/MotorControl ?

Yeah, that will do fine. You can also use nxt-python's nxt_push script.

--
Marcus Wanner
signature.asc

PtubbyTaylor

unread,
Apr 19, 2013, 10:49:06 PM4/19/13
to nxt-p...@googlegroups.com
I can't get the linux version of NeXTTools working (the bit to put the motcont file on the nxt), there isn't a windows version, and I don't have a mac. I tried using the nxt_push script, but it tells me something about an invalid file name. Could you explain a bit more in-depth on how I would use nxt_push to get it on there?

On Wednesday, April 17, 2013 11:04:59 AM UTC-4, PtubbyTaylor wrote:
I was wondering if anyone has some MotCont code they could share with me. I'm trying to run two motors simultaneously in opposite directions, for an arbitrary number of degrees. If anyone has some code that could get me started, that would be great. I'm not exactly sure how to get the MotorControl.rxe file on, should I follow the instructions on their website http://www.mindstorms.rwth-aachen.de/trac/wiki/MotorControl ?

Marcus Wanner

unread,
Apr 19, 2013, 11:10:03 PM4/19/13
to nxt-p...@googlegroups.com
On Fri, Apr 19, 2013 at 07:49:06PM -0700, PtubbyTaylor wrote:
> I can't get the linux version of NeXTTools working (the bit to put the
> motcont file on the nxt), there isn't a windows version, and I don't have a
> mac. I tried using the nxt_push script, but it tells me something about an
> invalid file name. Could you explain a bit more in-depth on how I would use
> nxt_push to get it on there?

Yes, give it a valid filename.

--
Marcus Wanner
signature.asc

Philip T

unread,
Apr 19, 2013, 11:11:31 PM4/19/13
to nxt-p...@googlegroups.com
eg, rename to "MotCont", without an extension, and push it?


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBCgAGBQJRcgcKAAoJEHkZLCwtmxuJCagQALk7gJREWO6U0Otp/NmtV+0q
qytZQdnmzNECkbwitTefksFYh4iCHvYXd4nNr5l1Fgf3leDQRRxhvMGkY5Y2CA2P
R0FKOZ3tsk6hpGQsf+ijaa43VbQeQNb92HN5wneDqZM2jhINTGs0gK8h1YhqGqUb
QKfsZZHkRqG15ykZeMa656zUWKeTnnyKWqWU3N5d9DqJte4exoB7osk2GuETCE4O
w750HqF0vDaW/U9yTa2RgDkeXapc81Gbg53/eaQpCb7vocg96zLBvhwjIXnv6QoW
Uknylmjq9XZrT0bOzyiSQJYbo3ug+Nu7ak1AsS1wu9TrRr2Uq7jLvTuVcEWA+12b
exfP1h4oRAi9YYtp5SjZQSCC0qEiMYaQyIqyXi85r4r1GTaKYe6dNuGGrocCiFjd
C64cvrWumhhwi11cE0WoXDi7BFex58kxsVokTKlSn54KbY8TENKuCRsj/L+11203
3HUabJKvBM0qC08klLBTYluDUABLQAC6ZEH0cagFR/x8Ru5o3lhWH88sU6KAyJTW
qRsp0cWN9s39K6Ye4sTRO91+hZwxx3itwt6caGGt29/4NUIX+6NJbnCFmI6L+coj
6oSTzs66Sag8m5l+/QkTxq7/UaB5xjLtanEN2NTx9vr8Gxj9nxoS558pno9izwV0
HFimWXPtrhbHBMzwzIVt
=oN9q
-----END PGP SIGNATURE-----


Marcus Wanner

unread,
Apr 19, 2013, 11:16:52 PM4/19/13
to nxt-p...@googlegroups.com
On Fri, Apr 19, 2013 at 11:11:31PM -0400, Philip T wrote:
> eg, rename to "MotCont", without an extension, and push it?

Nope, should be fine as it is.

--
Marcus Wanner
signature.asc
Reply all
Reply to author
Forward
0 new messages