Legacy RCX control using Direct Commands

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
mrbencowell
Posts: 6
Joined: 06 Jun 2011, 11:04

Legacy RCX control using Direct Commands

Post by mrbencowell »

Hello,

Does anyone know if there are any byte commands for controlling RCX motors via direct commands ?.

Many thanks
ben
hassenplug
Posts: 346
Joined: 27 Sep 2010, 03:05
Contact:

Re: Legacy RCX control using Direct Commands

Post by hassenplug »

Yes, there are direct IR commands (the IR remote used them)

Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Legacy RCX control using Direct Commands

Post by mattallen37 »

RCX motors run exactly the same as NXT motors, but they don't have the encoders. You should be able to use exactly the same commands, regardless of the motor (just remember that only the NXT motors have encoders).

Edit: Sorry, I thought you meant RCX motors with the NXT. To use direct command with the RCX, you should look at this page. You should also look at this one.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Legacy RCX control using Direct Commands

Post by mattallen37 »

I'm assuming you are using lego FW, and not a custom FW.

If you want to use direct motor commands, you can use 0x13 for motor power, 0x21 to specify the run-state of the motors, and 0xE1 to control the direction of the motors. These are OPcodes, and they are used when you create a program hex file, but can also be used as direct commands (IIRC).

Like Steve said, the remote uses a sort of direct command, but it uses a variation. If you only need run-state and direction control, the remote protocol would be a good option to use, as it is a fairly compact message. However, it is a different protocol makeup than the direct commands.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
mrbencowell
Posts: 6
Joined: 06 Jun 2011, 11:04

Re: Legacy RCX control using Direct Commands

Post by mrbencowell »

Sorry I should have been clearer, yes I'm attempting to control a device that is connected to my NXT, which responds to RCX motor commands. I'll try using the NXT motor commands and see if that works .. thank you !
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Legacy RCX control using Direct Commands

Post by mattallen37 »

The NXT uses pins 1 and 2 of the motor ports as the PWM motor power. The NXT->RCX connect pins 1 and 2 of the NXT plug to the RCX stud contacts.

However, the RCX and the NXT use a much different PWM. The RCX only uses a 3-bit PWM, and a very low frequency. The RCX also uses floating PWM. Depending on what this "device" is, it might matter that the NXT is so much different (although usually considered better).
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests