Use AFMotor Library


#1

Hi,

I’m creating a new extension that uses “AFMotor.h” library, but I don’t know how to add this library to Mblock 5.
In Arduino IDE I just put the AFMotor folder on the “Arduino/libraries/” directory and it works fine.
Someone could help me?

Thanks


#2

Hello @gsantos,
You need to upload the files in “Transcode Settings”, scrolling until the end of page.
Here a screenshot
When you upload and save the source files, the extension ship it and it is available for you in the block code.
Don’t forget include it where you use it in the form: “myCodeFolder/myCodeIncludeFile.h”


Regards
Rodrigo


#3

Thank you very much @ralcoberro,

My extension has stopped working even when I undo these settings :weary:

I tried everything, but I only get this message when viewing or downloading:
image

Att,


#4

Hello @gsantos,
Sometimes it happens. Try sign out and sign in again and/or clearing cookies

Regards
Rodrigo


#5

Hello @ralcoberro,
Thanks, again.

The error from viewing or downloading the original extension remains, but I’ve created a new extension test to check and the viewing process works:
image

The library is not shown automaticaly on the “Include” option, but I put manualy and tested in different ways <AFMotor/AFMotor.h>, <AFMotor.h>, <AFMotor\AFMotor.h>, AFMotor/AFMotor.h, but the compilation doesn’t recognize the library:
image

Any tip?

Thanks


#6

Hello @gsantos,
You need to put it manually as you did but “double quoted”. In this case "AFMotor/AFMotor.h"

Best regards
Rodrigo


#7

Hi @ralcoberro,

Good news!
At the first time it was not working, but today I dowloaded again and it seems that there is a new version of MBlock. I put as you wrote and it worked fine :clap::clap::clap:

Thank you very much. I’ll publish my extension “8bots actuators”.


#8

Hello gsantos, can you create a tutorial or screenshots on how you make your AFMotor extension. I’d like to make a motor controller extension for the L293d motor controller but am not clear on the sequence and steps when doing it with the extension builder.
Thanks


#9

Hi chonito,

We will have tutorials for similar extensions coming up these days. Stay tuned :grinning: