<?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[Robot with StickC, RoverC and TOF]]></title><description><![CDATA[<p dir="auto">I am trying to build a robot with roverC and UNIT TOF with UIFlow.<br />
When I am trying to start a Motors I am getting I2C-Error 19.<br />
After a reset I am getting " RoverC HAt may not be connected".<br />
Can anybody help me with the problem?</p>
]]></description><link>https://community.m5stack.com/topic/2174/robot-with-stickc-roverc-and-tof</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Mar 2026 23:21:48 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/2174.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 30 Jul 2020 13:24:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Robot with StickC, RoverC and TOF on Sun, 02 Aug 2020 12:34:21 GMT]]></title><description><![CDATA[<p dir="auto">I have copied the blocks as Micropython code:<br />
I put the Tof to the grove port of the stickC.<br />
for a little time it has worked.<br />
Now it reads some values and then it produces an I2C (Error 19)</p>
<p dir="auto">from m5stack import *<br />
from m5ui import *<br />
from uiflow import *<br />
lcd.setRotation(0)<br />
import time<br />
from m5mqtt import M5mqtt<br />
import unit<br />
import hat</p>
<p dir="auto">setScreenColor(0x111111)<br />
tof0 = unit.get(unit.TOF, unit.PORTA)</p>
<p dir="auto">hat_roverc0 = hat.get(hat.ROVERC)</p>
<p dir="auto">m5mqtt = M5mqtt('MyBot', '192.168.178.39', 1883, '', '', 300)</p>
<p dir="auto">label0 = M5TextBox(10, 10, "Hello", lcd.FONT_Default,0xFFFFFF, rotate=1)<br />
label4 = M5TextBox(50, 24, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)<br />
label1 = M5TextBox(10, 24, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)<br />
label5 = M5TextBox(50, 41, "Text", lcd.FONT_Default,0xFFFFFF, rotate=1)<br />
label6 = M5TextBox(50, 56, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)<br />
label2 = M5TextBox(10, 41, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)<br />
label3 = M5TextBox(10, 56, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)</p>
<p dir="auto">import math<br />
from numbers import Number</p>
<p dir="auto">myStr = None<br />
steuerung = None<br />
geschwindigkeit = None<br />
richtung = None<br />
drehung = None<br />
dummy = None<br />
pwrTen = None<br />
zahl = None<br />
auto = None<br />
mySpeed = None<br />
myTime = None<br />
i = None<br />
backSpeed = None<br />
start = None<br />
myChar = None<br />
dist = None</p>
<p dir="auto">def toInt(myStr):<br />
global steuerung, geschwindigkeit, richtung, drehung, dummy, pwrTen, zahl, auto, mySpeed, myTime, i, backSpeed, start, myChar, dist<br />
pwrTen = 0<br />
zahl = 0<br />
i = 0<br />
while i &lt; len(myStr):<br />
myChar = myStr[int(i - 1)]<br />
if myChar == '0':<br />
zahl = zahl * math.pow(10,pwrTen)<br />
else:<br />
if myChar == '1':<br />
zahl = zahl + 1 * math.pow(10,pwrTen)<br />
else:<br />
if myChar == '2':<br />
zahl = zahl + 2 * math.pow(10,pwrTen)<br />
else:<br />
if myChar == '3':<br />
zahl = zahl + 3 * math.pow(10,pwrTen)<br />
else:<br />
if myChar == '4':<br />
zahl = zahl + 4 * math.pow(10,pwrTen)<br />
else:<br />
if myChar == '5':<br />
zahl = zahl + 5 * math.pow(10,pwrTen)<br />
else:<br />
if myChar == '6':<br />
zahl = zahl + 6 * math.pow(10,pwrTen)<br />
else:<br />
if myChar == '7':<br />
zahl = zahl + 7 * math.pow(10,pwrTen)<br />
else:<br />
if myChar == '8':<br />
zahl = zahl + 8 * math.pow(10,pwrTen)<br />
else:<br />
if myChar == '9':<br />
zahl = zahl + 9 * math.pow(10,pwrTen)<br />
else:<br />
pass<br />
i = (i if isinstance(i, Number) else 0) + 1<br />
pwrTen = (pwrTen if isinstance(pwrTen, Number) else 0) + 1<br />
return zahl</p>
<p dir="auto">def fun_OmniBot_steuer_(topic_data):<br />
global steuerung, geschwindigkeit, richtung, drehung, dummy, pwrTen, zahl, auto, mySpeed, myTime, i, backSpeed, start, myChar, myStr, dist<br />
steuerung = topic_data<br />
label1.setText(str(steuerung))<br />
pass<br />
m5mqtt.subscribe(str('OmniBot/steuer'), fun_OmniBot_steuer_)</p>
<p dir="auto">def fun_OmniBot_geschwindigkeit_(topic_data):<br />
global steuerung, geschwindigkeit, richtung, drehung, dummy, pwrTen, zahl, auto, mySpeed, myTime, i, backSpeed, start, myChar, myStr, dist<br />
geschwindigkeit = topic_data<br />
label2.setText(str(geschwindigkeit))<br />
mySpeed = toInt(geschwindigkeit)<br />
backSpeed = -1 * mySpeed<br />
pass<br />
m5mqtt.subscribe(str('OmniBot/geschwindigkeit'), fun_OmniBot_geschwindigkeit_)</p>
<p dir="auto">def fun_OmniBot_richtung_(topic_data):<br />
global steuerung, geschwindigkeit, richtung, drehung, dummy, pwrTen, zahl, auto, mySpeed, myTime, i, backSpeed, start, myChar, myStr, dist<br />
richtung = topic_data<br />
label3.setText(str(richtung))<br />
pass<br />
m5mqtt.subscribe(str('OmniBot/richtung'), fun_OmniBot_richtung_)</p>
<p dir="auto">def fun_OmniBot_rotation_(topic_data):<br />
global steuerung, geschwindigkeit, richtung, drehung, dummy, pwrTen, zahl, auto, mySpeed, myTime, i, backSpeed, start, myChar, myStr, dist<br />
drehung = topic_data<br />
label4.setText(str(drehung))<br />
pass<br />
m5mqtt.subscribe(str('OmniBot/rotation'), fun_OmniBot_rotation_)</p>
<p dir="auto">def fun_OmniBot_auto_(topic_data):<br />
global steuerung, geschwindigkeit, richtung, drehung, dummy, pwrTen, zahl, auto, mySpeed, myTime, i, backSpeed, start, myChar, myStr, dist<br />
dummy = topic_data<br />
label5.setText(str(dummy))<br />
pass<br />
m5mqtt.subscribe(str('OmniBot/auto'), fun_OmniBot_auto_)</p>
<p dir="auto">auto = False<br />
myTime = 0<br />
mySpeed = 0<br />
start = (time.ticks_ms()) - myTime<br />
label0.setText('OmnibotRC V2-0-2')<br />
label4.setText('Hello M5')<br />
while True:<br />
dist = tof0.distance<br />
label6.setText(str(dist))<br />
wait_ms(50)<br />
if myTime == 0 or start &gt; 300000:<br />
myTime = time.ticks_ms()<br />
m5mqtt.start()<br />
else:<br />
pass<br />
if dist &gt; 50:<br />
M5Led.off()<br />
if richtung == 'stop' or steuerung == 'stop' or drehung == 'stop':<br />
hat_roverc0.SetAllPulse(0, 0, 0, 0)<br />
else:<br />
if richtung == 'forward':<br />
hat_roverc0.SetAllPulse(mySpeed, mySpeed, mySpeed, mySpeed)<br />
else:<br />
pass<br />
if richtung == 'back':<br />
hat_roverc0.SetAllPulse(backSpeed, backSpeed, backSpeed, backSpeed)<br />
else:<br />
pass<br />
if steuerung == 'left':<br />
hat_roverc0.SetAllPulse(mySpeed, backSpeed, backSpeed, mySpeed)<br />
else:<br />
pass<br />
if steuerung == 'right':<br />
hat_roverc0.SetAllPulse(backSpeed, mySpeed, mySpeed, backSpeed)<br />
else:<br />
pass<br />
if drehung == 'RotLeft':<br />
hat_roverc0.SetAllPulse(backSpeed, mySpeed, backSpeed, mySpeed)<br />
else:<br />
pass<br />
if drehung == 'RotRight':<br />
hat_roverc0.SetAllPulse(mySpeed, backSpeed, mySpeed, backSpeed)<br />
else:<br />
pass<br />
else:<br />
M5Led.on()<br />
wait_ms(2)</p>
]]></description><link>https://community.m5stack.com/post/9567</link><guid isPermaLink="true">https://community.m5stack.com/post/9567</guid><dc:creator><![CDATA[JhonnyTank]]></dc:creator><pubDate>Sun, 02 Aug 2020 12:34:21 GMT</pubDate></item><item><title><![CDATA[Reply to Robot with StickC, RoverC and TOF on Sun, 02 Aug 2020 09:47:20 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your reply! I think it was the power switch. I switched the rover only on when I realy want to drive it.</p>
]]></description><link>https://community.m5stack.com/post/9565</link><guid isPermaLink="true">https://community.m5stack.com/post/9565</guid><dc:creator><![CDATA[JhonnyTank]]></dc:creator><pubDate>Sun, 02 Aug 2020 09:47:20 GMT</pubDate></item><item><title><![CDATA[Reply to Robot with StickC, RoverC and TOF on Fri, 31 Jul 2020 07:01:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/3845">@jhonnytank</a> said in <a href="/post/9512">Robot with StickC, RoverC and TOF</a>:</p>
<blockquote>
<p dir="auto">I am trying to build a robot with roverC and UNIT TOF with UIFlow.<br />
When I am trying to start a Motors I am getting I2C-Error 19.<br />
After a reset I am getting " RoverC HAt may not be connected".<br />
Can anybody help me with the problem?</p>
</blockquote>
<p dir="auto">Is the StickC securly fitted and is the rover C power switch set to ON?</p>
]]></description><link>https://community.m5stack.com/post/9529</link><guid isPermaLink="true">https://community.m5stack.com/post/9529</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Fri, 31 Jul 2020 07:01:30 GMT</pubDate></item><item><title><![CDATA[Reply to Robot with StickC, RoverC and TOF on Fri, 31 Jul 2020 01:34:06 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/3845">@jhonnytank</a> ,</p>
<p dir="auto">Can you show your <strong>blocks</strong> with us and which port do you connect the TOF unit?</p>
]]></description><link>https://community.m5stack.com/post/9524</link><guid isPermaLink="true">https://community.m5stack.com/post/9524</guid><dc:creator><![CDATA[IAMLIUBO]]></dc:creator><pubDate>Fri, 31 Jul 2020 01:34:06 GMT</pubDate></item></channel></rss>