[Swlug] Quick Pythom question.
Rhys Sage
rhys_sage at yahoo.com
Wed Jul 13 22:29:20 UTC 2022
I found a lot of the demo code for the L76D doesn't actually work. Rather than modify it, I'm trying to add my own sections. I'm struggling a bit on my own with the Python so here's what I'm doing....
In Main.py I'm using this...
x.L76X_GetMoreData(x.GPS_Speed,x.GPS_Direction)
print('Speed ', x.GPS_Speed, ' Direction ', x.GPS_Direction)
in the L76X code I'm using this:
def L76X_GetMoreData(GPS_Speed, GPS_Direction):
#data = GPS_DATA
for i in range(0, BUFFSIZE-71):
if(ord(data[add]) == 36 and ord(data[add+1]) == 71 and (ord(data[add+2]) == 78 \
or ord(data[add+2]) == 80) and ord(data[add+3]) == 82 and ord(data[add+4]) == 77\
and ord(data[add+5]) == 67):
print("Bloody Hell, it works!")
# self.GPS_Speed = 0
# self.GPS_Direction = 0
#self.GPS_DATA = ""
But I'm getting errors...
Traceback (most recent call last):
File "<stdin>", line 56, in <module>
TypeError: function takes 2 positional arguments but 3 were given
I am mightily confused by this. What's going on? What am I misunderstanding?
Rhys Sage
More information about the Swlug
mailing list