Library AFMotor.h

Hello,
I am using a stepper demo program and a MH electronics Motor shield. The demo uses a library AFMotor.h as an include, which should send out the right things to the shiftregister and drivers of the shield.
I have a problem to understand how the AFMotor.h works. There are many defines in it and also declarations of functions, but what's inside in the functions and what is the detailed code, it is not visible. I cannot find a further include there either.

Maybe somebody can explain to me how it works.

Best regards
Dieter

Take a look at AFMotor.cpp to see the actual code rather than the function definitions. The library also comes with examples which demonstrate its use

Are you using the following Motor Shield by just inserting it on the top of Arduino UNO? If yes, then collect schematic of the shield from the net, connect a DC Motor, issue command to turn the Motor in the Forward direction and then begin to study the codes to see how they interact.
image

Hello, yes, thank you, that explains everything. I did not know that an installation of a .h-file latently copies a cpp-file as well. But now I saw it in the library folder. Thank you again.
Dieter

Yes, this is the shiled I'm using. But I connected a stepper motor, not a DC motor. The cpp-file answers my question.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.