Page 1 of 1

Help - Motor power output

Posted: 11 Dec 2011, 09:33
by cbhsnz
Hi,

Language: NXT-G 2.0

Situation: I have a motor (to drive a vehicle robot) with power control on, and want to read the the power level (because it dynamically changes due to the power control). I would like to simply just make a small program that plots power level against time on the NXT display as the car moves along.

Issue: Whenever I try connect a data wire from the motor data hub power level output, the wire breaks when it connects to anything. Just to test, I tried dragging it to the sound data hub volume input, but again, the wire breaks. Note that nothing is connected to the motor power level input as that would defeat the purpose of the motor control.

Any advice is appreciated. I'm just a beginner so excuse any ignorance!

Thanks

Re: Help - Motor power output

Posted: 12 Dec 2011, 13:50
by hassenplug
That connector is an INPUT, not an output. You can only connect an output wire there, if there is a wire coming in.

There's not really a way to read the motor power. I suggest when you set it, you also store that value for later use.

Steve

Re: Help - Motor power output

Posted: 13 Dec 2011, 10:44
by cbhsnz
Hi, thanks for your reply.

Yeah, by experiment, I found, as you said, that it will only allow an output motor power value if there is an input. But that defeats the purpose because I want to read the changing motor power, whereas the output will read the same as the input right?

Is there another method in NXT-G of reading the (dynamic) motor power level when motor power control is activated? Perhaps through use of the variable block reading and/or writing or something?

Thanks

Re: Help - Motor power output

Posted: 13 Dec 2011, 13:45
by hassenplug
No, I don't think there is a way to read the motor power, only set it.

Re: Help - Motor power output

Posted: 14 Dec 2011, 00:42
by peter-cocteau
Take a look to third party block: Moter Power Meter:

http://box.com/mindboards#/mindboards/% ... D/79073752

Peter.

Re: Help - Motor power output

Posted: 14 Dec 2011, 04:00
by cbhsnz
That suggested block is perfect! Thank you very much. It is exactly what I'm after. I thought my problem would have been encountered by many other people too, but found nothing about it on google. Glad to see someone has come across it too and made a fix!

Best regards,

Samuel
Christchurch, NZ