MeEncoderNew -> lock_state


#1

Hi there! In order to program the Encoder Motor Drivers I am using the class MeEncoderNew, just like it is done in the sample programs. When I looked through the different functions that are declared in this class there is one thing i really dont get:

Some functions are using the input argument “float lock_state”. What exactly is lock_state doing or in other words, what do I control if i change lock_state? I tried different values but couldn’t figure out myself what exactly is happening.

Maybe you can help me out. Thank you!


#2

Hi rus,

Here is a link which provide some explanation for the Arduino programs in the Makeblock library to you for reference. You may if it helps.


#3

The library doesn’t provide any explanation. That’s why I was hoping that you guys can help me :slight_smile:


#4

Hi rus,

Normally, for the arduino program, I am afraid that we can only provide limited support since this is beyond our ability. Hope you can understand.
While, here we have checked all the example programs under the Me_EncoderDriver_New, but didn’t find the float lock_state.
You may take a picture to show the example program you opened and the position for it, we will consult if any engineer can give a explanation for it.


#5

The float lock_state is included in the Class MeEncoderNew. Thus, it apperas in the file MeEncoderNew.cpp that can be found in the folder src of the makeblock library. Earlier in this thread, you send me a link of all the files included in the Makeblock library.

http://learn.makeblock.com/cn/Makeblock-library-for-Arduino/files.html

If you open that link and go to MeEncoderNew.cpp and scroll down a bit, you will see the float lock_state multiple times which is an input argument of some of the methods declared in this class.


#6

Hi rus,
The lock_state is set to control whether lock the motor after it went to the position. If lock it, you will not be able to rotate it by hand. 1 for lock and 0 for unlock.


#7