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
Mblock 3.3.2 - Library servo problem ARDUINO
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.
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?
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.
I’m facing the same issue. The Servo.h header is missing from the generated code.
Had to edit the generated file manually.
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.
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
Hi Vince_Dinic,
Thanks for sharing your opinion, this will be added to the requirement for next version mBlock.
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.
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.
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.
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.