<?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[(SOLVED) Change I2C pin in M5GFX Library (to use With ATOM LITE)]]></title><description><![CDATA[<p dir="auto">where are the pins assignements for I2C???</p>
<p dir="auto">I think I have to modify the library ...</p>
]]></description><link>https://community.m5stack.com/topic/3399/solved-change-i2c-pin-in-m5gfx-library-to-use-with-atom-lite</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 20:15:10 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3399.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 25 Jun 2021 15:05:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to (SOLVED) Change I2C pin in M5GFX Library (to use With ATOM LITE) on Wed, 14 Jul 2021 10:02:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/m5stack" aria-label="Profile: m5stack">@<bdi>m5stack</bdi></a> said in <a href="/post/14381">Change I2C pin in M5GFX Library (to use With ATOM LITE)</a>:</p>
<blockquote>
<p dir="auto">if you wanna change the I2C pin.  you could use this code.</p>
<pre><code>#include &lt;M5UnitOLED.h&gt;

//M5UnitOLED display; // default setting

M5UnitOLED display ( 21, 22, 400000 ); // SDA, SCL, FREQ

</code></pre>
</blockquote>
<p dir="auto">tnks a lot !!!</p>
]]></description><link>https://community.m5stack.com/post/14396</link><guid isPermaLink="true">https://community.m5stack.com/post/14396</guid><dc:creator><![CDATA[cepics]]></dc:creator><pubDate>Wed, 14 Jul 2021 10:02:14 GMT</pubDate></item><item><title><![CDATA[Reply to (SOLVED) Change I2C pin in M5GFX Library (to use With ATOM LITE) on Mon, 12 Jul 2021 08:15:18 GMT]]></title><description><![CDATA[<p dir="auto">if you wanna change the I2C pin.  you could use this code.</p>
<pre><code>#include &lt;M5UnitOLED.h&gt;

//M5UnitOLED display; // default setting

M5UnitOLED display ( 21, 22, 400000 ); // SDA, SCL, FREQ

</code></pre>
]]></description><link>https://community.m5stack.com/post/14381</link><guid isPermaLink="true">https://community.m5stack.com/post/14381</guid><dc:creator><![CDATA[m5stack]]></dc:creator><pubDate>Mon, 12 Jul 2021 08:15:18 GMT</pubDate></item><item><title><![CDATA[Reply to (SOLVED) Change I2C pin in M5GFX Library (to use With ATOM LITE) on Sun, 11 Jul 2021 10:33:28 GMT]]></title><description><![CDATA[<p dir="auto">tnks for the reply</p>
<p dir="auto">I tried to add <code> wire.h</code> library and call <code>  Wire.begin(26, 32)</code> but no joy....</p>
<pre><code>//The Game of Life, also known simply as Life, is a cellular automaton
//devised by the British mathematician John Horton Conway in 1970.
// https://en.wikipedia.org/wiki/Conway's_Game_of_Life
#include &lt;Wire.h&gt;
#include "M5Atom.h"
//#include &lt;Wire.h&gt;
#include &lt;Arduino.h&gt;
//#include &lt;Wire.h&gt;
#include &lt;M5GFX.h&gt;
#include &lt;M5UnitOLED.h&gt;
//#include &lt;M5UnitLCD.h&gt;

//M5GFX display;
M5UnitOLED display;
//M5UnitLCD display;

M5Canvas canvas[2];

void setup(void)
{
    M5.begin();            // Wire.begin() must be after M5.begin()
  Wire.begin(26, 32);    // Atom Matrix I2C GPIO Pin is 26 and 32 &lt;- Important
  display.begin();
  display.setEpdMode(epd_mode_t::epd_fastest);

  if (display.width() &lt; display.height())
  {
    display.setRotation(display.getRotation() ^ 1);
    display.setPivot(display.width() /2 -0.5, display.height() /2 - 0.5);
  }

  for (int i = 0; i &lt; 2; i++)
  {
    canvas[i].setColorDepth(8);
    canvas[i].createSprite(std::min(192, display.width()&gt;&gt;1), std::min(160, display.height()&gt;&gt;1));
    canvas[i].createPalette();
    canvas[i].setPaletteColor(1, TFT_WHITE);
    canvas[i].setPivot(canvas[i].width() /2 -0.5, canvas[i].height() /2 - 0.5);
  }
  canvas[0].setTextColor(1);
  canvas[0].setTextDatum(textdatum_t::bottom_center);
  canvas[0].drawString("Conway's", canvas[0].width() &gt;&gt; 1, canvas[0].height() &gt;&gt; 1);
  canvas[0].setTextDatum(textdatum_t::top_center);
  canvas[0].drawString("Game of Life", canvas[0].width() &gt;&gt; 1, canvas[0].height() &gt;&gt; 1);
  canvas[0].pushRotateZoom(&amp;display, 0,  (float)display.width() / canvas[0].width(), (float)display.height() / canvas[0].height());
  delay(1000);
}

void loop(void)
{
  bool flip = false;
  int width = canvas[flip].width();
  int height = canvas[flip].height();

  int y = 1;
  do
  {
    int x = 1;
    do
    {
      if (random(6) == 0) { canvas[flip].drawPixel(x, y, 1); }
    } while (++x &lt; width - 1);
  } while (++y &lt; height - 1);

  int diff;
  do
  {
    flip = !flip;
    diff = 0;

    auto old_buf = (uint8_t*)canvas[!flip].getBuffer();
    auto new_buf = (uint8_t*)canvas[ flip].getBuffer();
    int width  = canvas[flip].width();
    int height = canvas[flip].height();
    int py;
    int y  = height - 1;
    int ny = 0;
    do
    {
      py = y;
      y = ny;
      if (++ny == height) ny = 0;

      int px;
      int x  = width - 1;
      int nx = 0;
      do
      {
        px = x;
        x = nx;
        if (++nx == width) nx = 0;

        int neighbors = old_buf[px + py * width]
                      + old_buf[ x + py * width]
                      + old_buf[nx + py * width]
                      + old_buf[px +  y * width]
                      + old_buf[nx +  y * width]
                      + old_buf[px + ny * width]
                      + old_buf[ x + ny * width]
                      + old_buf[nx + ny * width];
        int idx = x + y * width;
        bool flg = (neighbors == 3) || (neighbors == 2 &amp;&amp; old_buf[idx]);
        if (flg != new_buf[idx])
        {
          new_buf[idx] = flg;
          ++diff;
        }
      } while (nx);
    } while (ny);

    canvas[flip].pushRotateZoom(&amp;display, 0,  (float)display.width() / width, (float)display.height() / height);
  } while (diff);
}
</code></pre>
<p dir="auto">with a I2C scanner  and the screen connected  I found the oled address</p>
<pre><code>

#include &lt;Wire.h&gt;


void setup()
{
  Wire.begin(26, 32);  
  
  Serial.begin(115200);
  while (!Serial);             // Leonardo: wait for serial monitor
  Serial.println("\nI2C Scanner");
}


void loop()
{
  byte error, address;
  int nDevices;

  Serial.println("Scanning...");

  nDevices = 0;
  for(address = 1; address &lt; 127; address++ ) 
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address&lt;16) 
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");

      nDevices++;
    }
    else if (error==4) 
    {
      Serial.print("Unknown error at address 0x");
      if (address&lt;16) 
        Serial.print("0");
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");

  delay(5000);           // wait 5 seconds for next scan
}
</code></pre>
<p dir="auto">serial moniror output:</p>
<pre><code>I2C Scanner
Scanning...
I2C device found at address 0x3C  !
done
</code></pre>
]]></description><link>https://community.m5stack.com/post/14378</link><guid isPermaLink="true">https://community.m5stack.com/post/14378</guid><dc:creator><![CDATA[cepics]]></dc:creator><pubDate>Sun, 11 Jul 2021 10:33:28 GMT</pubDate></item><item><title><![CDATA[Reply to (SOLVED) Change I2C pin in M5GFX Library (to use With ATOM LITE) on Tue, 06 Jul 2021 13:08:36 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://community.m5stack.com/topic/1842/m5atom-and-grove-sensors/3">https://community.m5stack.com/topic/1842/m5atom-and-grove-sensors/3</a></p>
]]></description><link>https://community.m5stack.com/post/14344</link><guid isPermaLink="true">https://community.m5stack.com/post/14344</guid><dc:creator><![CDATA[flypeek]]></dc:creator><pubDate>Tue, 06 Jul 2021 13:08:36 GMT</pubDate></item><item><title><![CDATA[Reply to (SOLVED) Change I2C pin in M5GFX Library (to use With ATOM LITE) on Sun, 04 Jul 2021 13:50:06 GMT]]></title><description><![CDATA[<p dir="auto">I tryed to change this lines in the M5UnitOLED.h file from</p>
<pre><code> static constexpr std::uint8_t M5_UNIT_OLED_SDA = 21;
 static constexpr std::uint8_t M5_UNIT_OLED_SCL = 22;
</code></pre>
<p dir="auto">to</p>
<pre><code> static constexpr std::uint8_t M5_UNIT_OLED_SDA = 26;
 static constexpr std::uint8_t M5_UNIT_OLED_SCL = 32;
</code></pre>
<p dir="auto">to match the ATOM GROVE I2C pin ....</p>
<p dir="auto">but no joy........</p>
]]></description><link>https://community.m5stack.com/post/14332</link><guid isPermaLink="true">https://community.m5stack.com/post/14332</guid><dc:creator><![CDATA[cepics]]></dc:creator><pubDate>Sun, 04 Jul 2021 13:50:06 GMT</pubDate></item></channel></rss>