Setup
Initialization functions and setup
This code works with the Feelix Core Library and the FeelixEffect C Library.
/* initialize commander for usage with SimpleFOC library */
//Commander command = Commander(Serial, '&', false);
/* initialize motor */
BLDCMotor _bldc = BLDCMotor(7);
/* for Feelix MiniDriver */
DRV8316Driver6PWM _driver =
DRV8316Driver6PWM(
STM32_INHA,
STM32_INLA,
STM32_INHB,
STM32_INLB,
STM32_INHC,
STM32_INLC,
STM32_SPI1_CS_DRV,
false);
/* similar for boards with AS5047 */
MagneticSensorSPI _sensor = MagneticSensorSPI(AS5147_SPI, STM32_SPI3_CS_ENC);
/* initialize Feelix */
FeelixM feelix = FeelixM(&_bldc, &_driver, &_sensor, 'A', State::NO_COMMUNICATION);
void setup() {
Serial.begin(115200);
feelix.init();
/* only required in the Feelix C library */
//command.add('F', process_data);
}
Last updated
Was this helpful?