Mblock 3.3.2 - Library servo problem ARDUINO


#1

in the 3.3.2 version of MBLOCK , when using the software in ARDUINO version and using the block "set the servo…etc. " in the source code the software is not included in the library of the servo ! can you resolve the problem in the next version of the software? Thanks


#2

when using Arduino related blocks, you need to attach them to a “start block” such as “Arduino Program” or “mBot Program” if you are using mBots. Otherwise it won’t compile into the source code that will be uploaded to the Arduino controller board.


#3

Hi there! I’m trying to control a servo with mblock and I have the same problem: The code that is generated doesn’t include the servo library and the message error is: ‘servo_9’ was not declared in this scope
’Servo’ does not name a type
When I edit the code and include #include <Servo.h> there are no message errors.

Why isn’t mblock including the servo library?


#4

Hi Ana,

Yes, the head file hasn’t been integrated into Arduino Program head.
Thanks for your feedback and advice, I will add it to customer feedback record and feedback to our engineers.


#5

Thank you! Keep the good work! Ana


#6

I’m facing the same issue. The Servo.h header is missing from the generated code.

Had to edit the generated file manually.


#7

Hi Yusman,

Yes, with the Arduino Program head, the Servo.h file hasn’t been integrated. If you use Orion Program head or mBot program head, the Servo.h file has been integrated.

Our engineer will modify this by adding it into Arduino Program head for next version.


#8

Let me explain ( I’m using google translate ) using as board Arduino one r3 and setting as the first block " Arduino program " , and using the servo block, the beginning is not loaded the library of the servo . To solve the problem must be added manually in the IDE Arduino #include < Servo.h > and then everything works . The problem is the educational use that does not allow the pupils utilizzre the block “set the servo at …” because they generally do not interact with the source code . Thanks , I hope I explained myself


#9

Hi Vince_Dinic,

Thanks for sharing your opinion, this will be added to the requirement for next version mBlock.


#10

What’s the status of this? I’m using v3.3.7 and the issue still exists?

Thanks,
Aram


#11

Hi Aramperez,

Yes, this hasn’t be modified in mBlock 3.3.7 since it is a little complex and will take some time.
We will inform the new updates for new version mBlock.


#12

I’m having a hard time understanding why this is considered “complex” to fix. If it is complex, then until issue is fixed, the servo “block” should be removed from mBlock. A similar situation exists with the Communications extension but with that extension you create an MeSerial object without including the correct header file. And the object is never used although Serial.begin is correctly added to the “setup” function.

If I have to use the “Edit with Arduino IDE” button and manually add the “include <Servo.h>” line, then it’s not that much more effort to manually create servo object.


#13

Yes this is an important issue that needs to be resolved. Since the servo function is an essential component. I am unable to proceed with my students in this area. Could you please move this issue to a higher priority.


#14

Hi Chonito &aramperez

This has been feedback to our engineer and will add the head file function for Arduino program head in the next version mBlock. Currently,the mBlock 3.3.8 is under testing, please keep noticing our new release.