Feelix
  • Feelix Documentation
  • Getting started
    • Designing Effects
      • Torque Effects
      • Position Effects
      • Velocity Effects
      • Dependent/Independent Effects
    • Effect Library
    • Creating Collections
  • Create and edit
    • Edit tools
    • Effect Settings
    • Layers
    • Grid
    • Export
    • TensorFlow
  • Uploading files
    • Setting up STM32
    • Connect and Upload
    • Hardware Settings
    • Troubleshooting Feelix
  • Hardware support
    • Hardware
    • PCB pinout
    • Setup
    • Dependencies
    • FeelixEffect Docs
      • Setup
      • Motor control
      • Import Effects
      • I2C communication
      • Example codes
  • Downloads
    • Feelix Design Tool
    • Feelix Arduino Library
    • 3D Models
    • Old Library Releases
Powered by GitBook
On this page

Was this helpful?

  1. Hardware support
  2. FeelixEffect Docs

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);
    
  }
PreviousFeelixEffect DocsNextMotor control

Last updated 3 days ago

Was this helpful?