Page 1 of 1
Legacy RCX control using Direct Commands
Posted: 08 Jun 2011, 15:01
by mrbencowell
Hello,
Does anyone know if there are any byte commands for controlling RCX motors via direct commands ?.
Many thanks
ben
Re: Legacy RCX control using Direct Commands
Posted: 08 Jun 2011, 18:08
by hassenplug
Yes, there are direct IR commands (the IR remote used them)
Steve
Re: Legacy RCX control using Direct Commands
Posted: 08 Jun 2011, 18:40
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.
Re: Legacy RCX control using Direct Commands
Posted: 08 Jun 2011, 18:57
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.
Re: Legacy RCX control using Direct Commands
Posted: 09 Jun 2011, 18:21
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 !
Re: Legacy RCX control using Direct Commands
Posted: 09 Jun 2011, 19:36
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).