How to persist motor control command without a loop?

2 years 4 months ago #29533719 by avinash_sprw
I'm using SDC2160 with firmware 1.8d. In Open loop mode, the command used to control the motor setcommand(_G, 1, 250) makes the motors run continuously only when the command is continuously given in a loop. Is it possible like when a command is given just once, the motor keeps running with that speed. For example, in Arduino programming, while interfacing a motor driver, the command that is used to given signal to a channel looks like: servo.write(180). This if executed once, will make the motor keep running in the forward direction at the max speed (180). Is it possible in Microbasic with SDC2160?

Please Log in or Create an account to join the conversation.

2 years 4 months ago #29533720 by LROBBINS
As far as I know _G persists unless either (1) a new _G arrives, or (2) the serial watchdog times out. Perhaps it is (2) that you are seeing? If so, you can turn off the watchdog (but do think about safety issues) or use a timer to repeat the _G at a bit less than the watchdog interval (that's needs a loop to see timer state, but it is a very "lightweight" loop).

On the other hand, perhaps I've misunderstood your question.

Please Log in or Create an account to join the conversation.

2 years 4 months ago #29533721 by avinash_sprw
Yes I have understood now. Seems it was the watchdog. I will look into it. Thank you very much

Please Log in or Create an account to join the conversation.

Time to create page: 0.140 seconds