<?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[Touchscreen not responding when using GoPlus2 with two servo motors]]></title><description><![CDATA[<p dir="auto">Hello everyone,<br />
I’m new to the forum and definitely new to programming M5Stack components.</p>
<p dir="auto">Let me explain my problem. I’m using a GoPlus2 module (with 2 servo motors connected to ports 1 and 2) together with a Core2. I also have an external power supply connected to the GoPlus2. What I did was create some code in UIFlow1 (v1.9.5) with buttons that control the servo motor positions. I actually made two versions of this code.</p>
<p dir="auto">In the first version, I didn’t explicitly control the motors but only printed the (theoretical) angle of the motors to the screen.<br />
In the second version, I added the actual control commands for the two servos.<br />
When running the first version, everything worked fine: I could see the correct angles displayed on the screen according to the button presses. However, when I ran the second version, the code froze right after pressing the start button, and the touchscreen stopped responding.</p>
<p dir="auto">I’ve attached the code for this second case:</p>
<pre><code>from m5stack import *
from m5stack_ui import *
from uiflow import *
import time
import module


screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xffffff)


cmdServo2 = None
running = None
resetAll = None
minus5 = None
plus5 = None
i = None
k = None

go_plus_2 = module.get(module.GOPLUS2)

Servo1 = M5Label('Servo 1 [deg]: ', x=24, y=48, color=0x000, font=FONT_MONT_14, parent=None)
Servo2 = M5Label('Servo 2 [deg]: ', x=165, y=48, color=0x000, font=FONT_MONT_14, parent=None)
touch_buttonStart = M5Btn(text='Start', x=24, y=91, w=70, h=30, bg_c=0xFFFFFF, text_c=0x000000, font=FONT_MONT_14, parent=None)
touch_buttonStop = M5Btn(text='Stop', x=125, y=91, w=70, h=30, bg_c=0xFFFFFF, text_c=0x000000, font=FONT_MONT_14, parent=None)
plus5deg = M5Btn(text='+ 5 deg', x=69, y=190, w=70, h=30, bg_c=0xFFFFFF, text_c=0x000000, font=FONT_MONT_14, parent=None)
minus5deg = M5Btn(text='- 5 deg', x=180, y=190, w=70, h=30, bg_c=0xFFFFFF, text_c=0x000000, font=FONT_MONT_14, parent=None)
title = M5Label('Test', x=138, y=17, color=0x000, font=FONT_MONT_14, parent=None)
switch0 = M5Switch(x=118, y=144, w=70, h=30, bg_c=0xCCCCCC, color=0x0288FB, parent=None)
cmdS1 = M5Label('Servo1', x=69, y=152, color=0x000, font=FONT_MONT_14, parent=None)
cmdS2 = M5Label('Servo2', x=190, y=152, color=0x000, font=FONT_MONT_14, parent=None)
reset = M5Btn(text='Reset', x=239, y=91, w=70, h=30, bg_c=0xFFFFFF, text_c=0x000000, font=FONT_MONT_14, parent=None)

from numbers import Number



def switch0_on():
  global cmdServo2, running, resetAll, minus5, plus5, i, k
  cmdServo2 = True
  minus5 = False
  plus5 = False
  pass
switch0.on(switch0_on)

def touch_buttonStart_pressed():
  global cmdServo2, running, resetAll, minus5, plus5, i, k
  running = True
  title.set_text('Start')
  wait(2)
  Servo1.set_text(str((str('Servo 1 [deg]:') + str(90))))
  Servo2.set_text(str((str('Servo 2 [deg]:') + str(90))))
  go_plus_2.set_servo_angle(go_plus_2.S1, 90)
  go_plus_2.set_servo_angle(go_plus_2.S2, 90)
  pass
touch_buttonStart.pressed(touch_buttonStart_pressed)

def touch_buttonStop_pressed():
  global cmdServo2, running, resetAll, minus5, plus5, i, k
  running = False
  i = 0
  k = 0
  plus5 = False
  minus5 = False
  pass
touch_buttonStop.pressed(touch_buttonStop_pressed)

def reset_pressed():
  global cmdServo2, running, resetAll, minus5, plus5, i, k
  resetAll = True
  running = False
  plus5 = False
  minus5 = False
  cmdServo2 = False
  switch0.set_off()
  pass
reset.pressed(reset_pressed)

def plus5deg_pressed():
  global cmdServo2, running, resetAll, minus5, plus5, i, k
  minus5 = False
  plus5 = True
  pass
plus5deg.pressed(plus5deg_pressed)

def minus5deg_pressed():
  global cmdServo2, running, resetAll, minus5, plus5, i, k
  plus5 = False
  minus5 = True
  pass
minus5deg.pressed(minus5deg_pressed)


running = False
resetAll = False
i = 90
k = 90
while True:
  while not running:
    title.set_text('Stop')
    if resetAll:
      title.set_text('Reset')
      Servo1.set_text(str((str('Servo 1 [deg]:') + str(90))))
      Servo2.set_text(str((str('Servo 2 [deg]:') + str(90))))
      go_plus_2.set_servo_angle(go_plus_2.S1, 90)
      go_plus_2.set_servo_angle(go_plus_2.S2, 90)
      wait(2)
      resetAll = False
  while running:
    if resetAll:
      title.set_text('Reset')
      Servo1.set_text(str((str('Servo 1 [deg]:') + str(90))))
      Servo2.set_text(str((str('Servo 2 [deg]:') + str(90))))
      go_plus_2.set_servo_angle(go_plus_2.S1, 90)
      go_plus_2.set_servo_angle(go_plus_2.S2, 90)
      wait(2)
      resetAll = False
    if cmdServo2:
      title.set_text('Comanding Servo 2')
      if plus5:
        if k == 180:
          k = 90
        Servo2.set_text(str((str('Servo 2 [deg]: ') + str(k))))
        go_plus_2.set_servo_angle(go_plus_2.S2, k)
        wait(1)
        k = (k if isinstance(k, Number) else 0) + 5
      if minus5:
        if k == 0:
          k = 90
        Servo2.set_text(str((str('Servo 2 [deg]: ') + str(k))))
        go_plus_2.set_servo_angle(go_plus_2.S2, k)
        wait(1)
        k = (k if isinstance(k, Number) else 0) + -5
    if not cmdServo2:
      title.set_text('Comanding Servo 1')
      if plus5:
        if i == 180:
          i = 90
        Servo1.set_text(str((str('Servo 1 [deg]: ') + str(i))))
        go_plus_2.set_servo_angle(go_plus_2.S1, i)
        wait(1)
        i = (i if isinstance(i, Number) else 0) + 5
      if minus5:
        if i == 0:
          i = 90
        Servo1.set_text(str((str('Servo 1 [deg]: ') + str(i))))
        go_plus_2.set_servo_angle(go_plus_2.S1, i)
        wait(1)
        i = (i if isinstance(i, Number) else 0) + -5

</code></pre>
<p dir="auto">To rule out an issue with the motors, I also created a simple routine that moves the servos back and forth between 60 and 120 degrees. Without interacting with the touchscreen, I didn’t experience any problems.</p>
<p dir="auto">Do you have any advice or suggestions on how I could solve this issue?</p>
<p dir="auto">P.S. I’m not using UIFlow2 because when I connect everything and try to run any code, the motors start vibrating heavily and I get the following error:</p>
<pre><code>E (28183) i2c: i2c driver install error 
E (28183) i2c: i2c driver install error
Traceback (most recent call last): 
  File "&lt;stdin&gt;", line 5, in &lt;module&gt; 
  File "module/goplus2.py", line 43, in __init__ 
Exception: GoPlus2 Module not found in Base
</code></pre>
<p dir="auto">Thanks a lot in advance!</p>
]]></description><link>https://community.m5stack.com/topic/7811/touchscreen-not-responding-when-using-goplus2-with-two-servo-motors</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 23:34:23 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7811.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 Sep 2025 13:47:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Touchscreen not responding when using GoPlus2 with two servo motors on Mon, 22 Sep 2025 21:26:20 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/eleonorafontana16" aria-label="Profile: eleonorafontana16">@<bdi>eleonorafontana16</bdi></a></p>
<p dir="auto">just to clarify - your current setup (controlling 2 servos using GPIO25 and GPIO26) doesn't include the GoPlus2 module anymore, correct?</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/29984</link><guid isPermaLink="true">https://community.m5stack.com/post/29984</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Mon, 22 Sep 2025 21:26:20 GMT</pubDate></item><item><title><![CDATA[Reply to Touchscreen not responding when using GoPlus2 with two servo motors on Thu, 18 Sep 2025 13:20:46 GMT]]></title><description><![CDATA[<p dir="auto">Thanks again <a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a>.</p>
<p dir="auto">I noticed that I can actually control two servos by simply connecting them directly to the GPIO25 and GPIO26 pins of the Core2. I’m using an external power supply and I’ve made sure that the GND is shared between the Core2 and the two servos.</p>
<p dir="auto">My question now is: based on your experience, can I safely use the Core2 touchscreen while controlling the servos through a UIFlow 1 interface while connecting to the PC via a USB-C cable?</p>
<p dir="auto">Do you think this setup is feasible? Are there any precautions I should take?</p>
]]></description><link>https://community.m5stack.com/post/29959</link><guid isPermaLink="true">https://community.m5stack.com/post/29959</guid><dc:creator><![CDATA[eleonorafontana16]]></dc:creator><pubDate>Thu, 18 Sep 2025 13:20:46 GMT</pubDate></item><item><title><![CDATA[Reply to Touchscreen not responding when using GoPlus2 with two servo motors on Sun, 14 Sep 2025 06:14:07 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/eleonorafontana16" aria-label="Profile: eleonorafontana16">@<bdi>eleonorafontana16</bdi></a></p>
<p dir="auto">I don't know whether it will affect one or the other or both long term. The fact that both use the same I2C address is like talking to two people with the same name. Some answers might get lost due to both people responding at the same time with different answers.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/29935</link><guid isPermaLink="true">https://community.m5stack.com/post/29935</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Sun, 14 Sep 2025 06:14:07 GMT</pubDate></item><item><title><![CDATA[Reply to Touchscreen not responding when using GoPlus2 with two servo motors on Fri, 12 Sep 2025 08:12:03 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a>,<br />
Oh, I didn’t know that, thanks for pointing it out! Do you think this incompatibility only affects the touchscreen, or could it also impact other aspects, like the long-term control of two servo motors?</p>
<p dir="auto">Also, if I wanted to get another component that allows me to build a GUI to interact with, is there a particular product you would recommend?</p>
<p dir="auto">Thanks a lot for your help!<br />
Eleonora</p>
]]></description><link>https://community.m5stack.com/post/29925</link><guid isPermaLink="true">https://community.m5stack.com/post/29925</guid><dc:creator><![CDATA[eleonorafontana16]]></dc:creator><pubDate>Fri, 12 Sep 2025 08:12:03 GMT</pubDate></item><item><title><![CDATA[Reply to Touchscreen not responding when using GoPlus2 with two servo motors on Thu, 11 Sep 2025 14:59:34 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/eleonorafontana16" aria-label="Profile: eleonorafontana16">@<bdi>eleonorafontana16</bdi></a></p>
<p dir="auto">Unfortunately M5Core2 and GoPlus2 are not compatible. From the GoPlus2 shop <a href="https://shop.m5stack.com/products/goplus2-dc-motor-and-servo-driver-module-stm32f0" target="_blank" rel="noopener noreferrer nofollow ugc">page</a>:</p>
<p dir="auto"><em>Note: This module has an I2C address conflict with the touch screen of the CORE2, so it cannot be used together.</em></p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/29921</link><guid isPermaLink="true">https://community.m5stack.com/post/29921</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 11 Sep 2025 14:59:34 GMT</pubDate></item></channel></rss>