2019-11-25, 03:22 AM
(This post was last modified: 2019-11-25, 01:25 PM by CapnKernel.)
(2019-11-25, 01:47 AM)CapnKernel Wrote: Is it worth having a preprocessor var that's the name of the driver, eg "VNH2SP30", "IBT_2". And could the pin 6 functionality (RC vs H-bridge, which is currently done at run-time) be done with this var too?
I see that @partyvi is adding support for the TI DRV8873H:
https://github.com/partyvi/Pypilot_motor.../motor.ino
This could also be another possible value for the var, eg,
Code:
// #define DRIVER RC
// #define DRIVER VNH2SP30
// #define DRIVER IBT_2
// #define DRIVER DRV8873H
#ifndef DRIVER
# error You need to choose and uncomment one of the drivers above
#endif
Code:
#if DRIVER == VNH2SP30
// Conditional code here
#endif
Thoughts?