<?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[Using atom-mate with cback-driver.]]></title><description><![CDATA[<p dir="auto">I¡m trying to run a couple of servos with atom lite, using the atom-mate and the cback-driver for m5stick. Using platformio, I've copied <a href="https://github.com/m5stack/M5StickC/tree/master/examples/Hat/CBACK_DRIVER" target="_blank" rel="noopener noreferrer nofollow ugc">CBACK_DRIVER.h and CBACK_DRIVER.cpp</a> to the include dir in the project, modified the obvious #include &lt;M5Atom.h&gt;, and with this code:</p>
<pre><code>#include &lt;M5Atom.h&gt;
#include "CBACK_DRIVER.h"

bool flag = true;

CBACK_DRIVER Driver;
int C_BLACK = 0x000000;
int C_WHITE = 0xffffff;
int C_RED = 0xff0000;
int C_GREEN = 0x00ff00;
int C_BLUE = 0x0000ff;


void setup() {
        M5.begin(true, false, true);
        // let's check the atom is ok
        delay(50);
        M5.dis.drawpix(0, C_GREEN); // green
        delay(1000);
        M5.dis.drawpix(0, C_BLACK); // black
        Serial.begin(115200);
                Driver.Init();
                delay(1000);
                Serial.println("C Back Driver Test...");

}
void loop() {
        if(M5.Btn.wasPressed()){
                flag = !flag;
                Serial.println("toggle flag value");
        }
        if(flag){
                for(int i=1; i&lt;=4;i++){
                        Driver.SetServoAngle(i,90);
                        Serial.println("servo 90");
                        // Driver.ReadServoPulse(i,1500);
                }
                Driver.SetOutput(1);
        }else{
                for(int i=1; i&lt;=4;i++){
                        Driver.SetServoAngle(i,120);
                        Serial.println("servo 120");
                        // Driver.ReadServoPulse(i,2000);
                }
                Driver.SetOutput(0);
        }
        Serial.print("PortB ADC: ");
        Serial.println(Driver.ReadADC());
        M5.update();
}
</code></pre>
<p dir="auto">I get this error:</p>
<pre><code>Building in release mode
Linking .pio/build/m5stack-atom/firmware.elf
.pio/build/m5stack-atom/src/main.cpp.o:(.literal._Z5setupv+0x2c): undefined reference to `CBACK_DRIVER::Init()'
.pio/build/m5stack-atom/src/main.cpp.o:(.literal._Z4loopv+0x18): undefined reference to `CBACK_DRIVER::SetServoAngle(unsigned char, unsigned char)'
.pio/build/m5stack-atom/src/main.cpp.o:(.literal._Z4loopv+0x1c): undefined reference to `CBACK_DRIVER::SetOutput(unsigned char)'
.pio/build/m5stack-atom/src/main.cpp.o:(.literal._Z4loopv+0x20): undefined reference to `CBACK_DRIVER::ReadADC()'
.pio/build/m5stack-atom/src/main.cpp.o: In function `setup()':
/home/benalb/Projects/m5atom/cback/src/main.cpp:22: undefined reference to `CBACK_DRIVER::Init()'
.pio/build/m5stack-atom/src/main.cpp.o: In function `loop()':
/home/benalb/Projects/m5atom/cback/src/main.cpp:36: undefined reference to `CBACK_DRIVER::SetServoAngle(unsigned char, unsigned char)'
/home/benalb/Projects/m5atom/cback/src/main.cpp:40: undefined reference to `CBACK_DRIVER::SetServoAngle(unsigned char, unsigned char)'
/home/benalb/Projects/m5atom/cback/src/main.cpp:44: undefined reference to `CBACK_DRIVER::SetOutput(unsigned char)'
/home/benalb/Projects/m5atom/cback/src/main.cpp:47: undefined reference to `CBACK_DRIVER::ReadADC()'
collect2: error: ld returned 1 exit status
*** [.pio/build/m5stack-atom/firmware.elf] Error 1
========================================================= [FAILED] Took 13.90 seconds =========================================================

</code></pre>
<p dir="auto">any ideas?</p>
]]></description><link>https://community.m5stack.com/topic/3799/using-atom-mate-with-cback-driver</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 15:36:33 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3799.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 03 Dec 2021 15:10:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Using atom-mate with cback-driver. on Fri, 03 Dec 2021 21:15:41 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/benalb" aria-label="Profile: benalb">@<bdi>benalb</bdi></a></p>
<p dir="auto">according to the <a href="https://docs.m5stack.com/en/hat/c_back_driver" target="_blank" rel="noopener noreferrer nofollow ugc">C Back Driver schematic</a> the four channels are powered from the <code>+BAT</code> pin the M5StickC provides but is missing when using an M5Atom with the atom-mate.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/15712</link><guid isPermaLink="true">https://community.m5stack.com/post/15712</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Fri, 03 Dec 2021 21:15:41 GMT</pubDate></item><item><title><![CDATA[Reply to Using atom-mate with cback-driver. on Fri, 03 Dec 2021 16:36:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a>  thanks, now it compiles and uploads to the atom. But it does not work. I have also changed the ports in CBACK_DRIVER.cpp to match the ones of the  atom-mate, from</p>
<pre><code>Wire.begin(0, 26);
</code></pre>
<p dir="auto">to</p>
<pre><code>Wire.begin(19,22);
</code></pre>
<p dir="auto">but no luck.</p>
]]></description><link>https://community.m5stack.com/post/15704</link><guid isPermaLink="true">https://community.m5stack.com/post/15704</guid><dc:creator><![CDATA[benalb]]></dc:creator><pubDate>Fri, 03 Dec 2021 16:36:10 GMT</pubDate></item><item><title><![CDATA[Reply to Using atom-mate with cback-driver. on Fri, 03 Dec 2021 16:01:30 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/benalb" aria-label="Profile: benalb">@<bdi>benalb</bdi></a></p>
<p dir="auto">the <code>.cpp</code> file should go into the <code>src</code> instead of the <code>include</code> directory, else it doesn't get compiled nor linked.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/15702</link><guid isPermaLink="true">https://community.m5stack.com/post/15702</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Fri, 03 Dec 2021 16:01:30 GMT</pubDate></item></channel></rss>