Page 1 of 1

RCX motor control

Posted: 18 Apr 2011, 18:29
by mattallen37
In NQC, is there a way to set the power using the brake? What I want, is to do a brake PWM speed control. All I know how to do, is floating PWM. Brake PWM will allow a much better speed control, not just power.

Re: RCX motor control

Posted: 19 Apr 2011, 21:55
by afanofosc
All that you can do in NQC to control the RCX motors is documented in the NQC Programmer's Guide and the NQC help. There is nothing else that you can do other than what those docs say you can do. IIRC, anyway.

John Hansen

Re: RCX motor control

Posted: 19 Apr 2011, 22:40
by mattallen37
Okay. I checked to see what the Opcode is for the motor control. It is opcode 0x21. Bits 6 and 7 are for float, brake, and run. NQC only supports 0, 1, and 2 (float, brake, and on). I thought that maybe writing it 3 (brake and on), is what I wanted. There is obviously no NQC command for the command, so I programmed it with machine code. I didn't do what I wanted though... It looks like it isn't supported. I guess I may just do it with HW. Thanks for the information.

Re: RCX motor control

Posted: 19 Apr 2011, 23:27
by afanofosc
With the RCX brake means off with power. It isn't a mask that you can add to either float or on. It would have been documented and supported in NQC (and via BricxCC tool windows) if it could have been done.

John Hansen