Thanks very much for taking the time to develop NXT++ it works great. I am having trouble with 1 command though and i was hoping you can help. I am trying to get my NXT to control a third party DC motor. Everything is hooked up and working but i cannot control the power/speed of the motor. If i use the LEGO MINDSTORMS program to make a program to set the power to '25' i notice the motor spins slowly, and when i set the power to '100' the motor spins fast. So i know the motor and controller work fine together. When i use your NXT++ command 'NXT::Motor::SetForward(&comm, OUT_A, 25)' the motor spins at the same speed as if i set the power level too 100. The only difference is at a power level of 25 it takes LONGER to reach this speed. Is there maybe something wrong with this function? or am i doing something wrong?
Thanks
Rayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For anyone trying to control the power level properly this is an easy way to do it. The POWER can be anywhere from -100 to 100. ALSO it is good to note that depending on your motor it might not start spinning till the power level ish 55ish depending on the size and electrical requirments of the motor. Dont be surprised if you put a power level of 40 and your motor does not turn.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Thanks very much for taking the time to develop NXT++ it works great. I am having trouble with 1 command though and i was hoping you can help. I am trying to get my NXT to control a third party DC motor. Everything is hooked up and working but i cannot control the power/speed of the motor. If i use the LEGO MINDSTORMS program to make a program to set the power to '25' i notice the motor spins slowly, and when i set the power to '100' the motor spins fast. So i know the motor and controller work fine together. When i use your NXT++ command 'NXT::Motor::SetForward(&comm, OUT_A, 25)' the motor spins at the same speed as if i set the power level too 100. The only difference is at a power level of 25 it takes LONGER to reach this speed. Is there maybe something wrong with this function? or am i doing something wrong?
Thanks
Rayne
int POWER = 100;
ViByte dc_buf = {0x04, 0x00, POWER, 0x01, 0x01, 0, 0x20, 0x00, '\0'};
NXT::SendDirectCommand(&comm, false, dc_buf, sizeof(dc_buf), NULL, 0);
For anyone trying to control the power level properly this is an easy way to do it. The POWER can be anywhere from -100 to 100. ALSO it is good to note that depending on your motor it might not start spinning till the power level ish 55ish depending on the size and electrical requirments of the motor. Dont be surprised if you put a power level of 40 and your motor does not turn.