<?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[GPS: calculate deviation between two course]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I'm new to UIFlow and Pyhton and run into a problem:</p>
<p dir="auto">I get a course from GPS and store it (after button press) in courseset.<br />
After that I want to show the deviation but it cannot make the calculation:</p>
<p dir="auto">def buttonC_wasPressed():<br />
global setcourse, curcourse, coursediff, gps<br />
if curcourse:<br />
setcourse = curcourse<br />
label6.setText(str(setcourse))<br />
pass<br />
btnC.wasPressed(buttonC_wasPressed)</p>
<p dir="auto">curcourse = gps.course</p>
<p dir="auto">coursediff = curcourse - setcourse. // this line results in "Can't convert 'float' object to str implicitly"</p>
<p dir="auto">Any suggestions?<br />
Thanks!!!</p>
]]></description><link>https://community.m5stack.com/topic/4590/gps-calculate-deviation-between-two-course</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 06:43:04 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/4590.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Sep 2022 15:04:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to GPS: calculate deviation between two course on Wed, 07 Sep 2022 11:23:45 GMT]]></title><description><![CDATA[<p dir="auto">Try (str(str(setcourse)))<br />
Putting the str in a second time sometimes works as it would appear that the original str sometimes get ignored.<br />
Why, I don’t know but I’ve used this trick myself a few times now.</p>
]]></description><link>https://community.m5stack.com/post/18567</link><guid isPermaLink="true">https://community.m5stack.com/post/18567</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Wed, 07 Sep 2022 11:23:45 GMT</pubDate></item></channel></rss>