PosRegEnable -does'nt work

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: PosRegEnable -does'nt work

Post by HaWe »

Code: Select all

SetOutput(PORT, PowerField, 0,
                        OutputModeField, OUT_MODE_MOTORON|OUT_MODE_BRAKE|OUT_MODE_REGULATED,
                        RegModeField, OUT_REGMODE_SPEED,
                        RunStateField, OUT_RUNSTATE_RUNNING,
                        TachoLimitField, 0,
                        UpdateFlagsField, UF_UPDATE_TACHO_LIMIT|UF_UPDATE_MODE|UF_UPDATE_SPEED);
Hell, what a function call to brake a motor! Or does it more than just brake? I don't see through that elaboration.
Anyway, I think I'll propose it for the Nobel Prize for Literature :D
felix2ch
Posts: 33
Joined: 11 Jun 2013, 16:46

Re: PosRegEnable -does'nt work

Post by felix2ch »

doc-helmut wrote: Hell, what a function call to brake a motor! Or does it more than just brake? I don't see through that elaboration.
Anyway, I think I'll propose it for the Nobel Prize for Literature :D
That 's why john said " though that could easily be wrapped in a preprocessor macro API function. ".
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: PosRegEnable -does'nt work

Post by HaWe »

surely it can be done.
Related to the original source code, I'm simply confused about the original number of letters, the (actually, apparently) non-C-like syntax structure, it's complexity and sophistication and the amount of OR-ed expressions or variables which are cited.
(That's one of the reasons why I in principle use my own PID controller, hereby I know what it does and how it works - but that's admittedly my own personal problem and should not (and must not ) bother you in any way.)
felix2ch
Posts: 33
Joined: 11 Jun 2013, 16:46

Re: PosRegEnable -does'nt work

Post by felix2ch »

doc-helmut wrote:surely it can be done.
Related to the original source code, I'm simply confused about the original number of letters, the (actually, apparently) non-C-like syntax structure, it's complexity and sophistication and the amount of OR-ed expressions or variables which are cited.
(That's one of the reasons why I in principle use my own PID controller, hereby I know what it does and how it works - but that's admittedly my own personal problem and should not (and must not ) bother you in any way.)
Yes, it should be more clearly and more flexible if use own PID controller.Of course, all regulation options in firmware will be give up.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests