Reading MMOD in script always returns 0
2 years 8 months ago #29535321
by skelmir
Reading MMOD in script always returns 0 was created by skelmir
getconfig(_MMOD, [1|2]) always returns 0 regardless of motor mode. Serial command ~MMOD returns the correct value, but that doesn't seem to be accessible from scripting. I was trying to determine the initial state of the motors to check if they are in open or closed mode. There wasn't anything in the documentation that I could find that said that value wasn't accessible from scripting, so I assume it must be a bug.
----
Option Explicit
dim motor1Mode as integer
dim motor2Mode as integer
Top:
motor1Mode = getvalue(_MMOD, 1)
motor2Mode = getvalue(_MMOD, 2)
Print("Motor Mode 1=",motor1Mode," 2=",motor2Mode,"\n")
wait(1000)
goto Top
----
Option Explicit
dim motor1Mode as integer
dim motor2Mode as integer
Top:
motor1Mode = getvalue(_MMOD, 1)
motor2Mode = getvalue(_MMOD, 2)
Print("Motor Mode 1=",motor1Mode," 2=",motor2Mode,"\n")
wait(1000)
goto Top
Please Log in or Create an account to join the conversation.
2 years 8 months ago #29535322
by skelmir
Replied by skelmir on topic Reading MMOD in script always returns 0
My mistake. Was calling getvalue() instead of getconfig().
Please Log in or Create an account to join the conversation.
Time to create page: 0.047 seconds