<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Unit_Roller and SimpleFOC.h]]></title><description><![CDATA[<p dir="auto">Hi all</p>
<p dir="auto">I would like to play with Unit_Roller and SimpleFOC.h but I don't know how to setup the Motor configuration..</p>
<p dir="auto">is there an Arduino example for unit_roller using SimpleFOC.h?</p>
<p dir="auto">I'm using M5Nanoc6 as controller</p>
<p dir="auto">this code compile but doesn't produce any motor movement.</p>
<pre><code>#include "SimpleFOC.h"
#include "unit_rolleri2c.hpp"
#include &lt;M5Unified.h&gt;

// Create a Unit Roller object
UnitRollerI2C RollerI2C;

// Motor configuration for SimpleFOC
BLDCMotor motor = BLDCMotor(7);
BLDCDriver3PWM driver = BLDCDriver3PWM(9, 10, 11, 8);

void setup() {
    M5.begin();

    // Initialize the Unit Roller
    if (RollerI2C.begin(&amp;Wire, 0x64, 2, 1, 400000)) {
        M5.Lcd.println("Roller initialized");
    }

    // Initialize the SimpleFOC driver
    driver.voltage_power_supply = 12;
    driver.init();
    motor.linkDriver(&amp;driver);

    // Motor control mode
    motor.controller = MotionControlType::velocity;

    // Initialize the motor
    motor.init();
    motor.initFOC();
}

void loop() {
    // Motor control using SimpleFOC
    motor.loopFOC();
    motor.move(2);
}
</code></pre>
<p dir="auto">any tips</p>
<p dir="auto">best regards</p>
]]></description><link>https://community.m5stack.com/topic/7575/unit_roller-and-simplefoc-h</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 23:11:34 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7575.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 26 May 2025 14:59:32 GMT</pubDate><ttl>60</ttl></channel></rss>