Reputation: 29
A quick trivial question: I want to write numeric variables to serial in Python. This is being done inside an if loop. Something like:
If(condition=true):
ser.write(str(value1)
ser.write(str(value2)
Would this be correct?
Or should I rather do:
If(condition=true):
ser.write(str(value1), (str(value2))
I know this is trivial, but got stuck here. Writing these values to Arduino.
Thanks in advance
Upvotes: 0
Views: 73
Reputation: 169
Instead of writing each value differently, what you can do is make a string of the values and then decode the string on arduino to get the values from the encoded data. Here is the list of functions you can perform on the list and in most cases do the work required.
Happy Coding. Hope this will help.
Upvotes: 1