GPS: calculate deviation between two course
-
Hi,
I'm new to UIFlow and Pyhton and run into a problem:I get a course from GPS and store it (after button press) in courseset.
After that I want to show the deviation but it cannot make the calculation:def buttonC_wasPressed():
global setcourse, curcourse, coursediff, gps
if curcourse:
setcourse = curcourse
label6.setText(str(setcourse))
pass
btnC.wasPressed(buttonC_wasPressed)curcourse = gps.course
coursediff = curcourse - setcourse. // this line results in "Can't convert 'float' object to str implicitly"
Any suggestions?
Thanks!!! -
Try (str(str(setcourse)))
Putting the str in a second time sometimes works as it would appear that the original str sometimes get ignored.
Why, I don’t know but I’ve used this trick myself a few times now.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login