RCX motor control

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

RCX motor control

Post 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.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: RCX motor control

Post 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
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: RCX motor control

Post 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.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: RCX motor control

Post 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
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 0 guests