8.2 Interface to the Model

  1. Initialize the model in main.c.
    /* Initialize MPLABML Knowledge Pack */
    kb_model_init();
  2. Call the sml recognition function as long as there are samples (rdcnt) in the queue.
    ...
    while (rdcnt--) 
    {
    int ret = sml_recognition_run((sample_data_t *) ptr++, NUM_AXES);
    ... 
  3. In app_config.h, ensure the macro DATA_STREAMER_FORMAT is set to APP.
    // Data streaming formatting selection
    #ifndef DATA_STREAMER_FORMAT
    #define DATA_STREAMER_FORMAT DATA_STREAMER_FORMAT_APP
    #endif
  4. Build and flash to the device.
Note: To see the demo in action, after these steps, follow the Use Data Visualizer streamer to see the classification.