3
I’m trying to translate the following code to C++:
https://github.com/JohanLink/Ball-Balancing-PID-System/blob/master/pythonCodes/interface.py
I wanted to understand what the following line does:
ser.write((str(dataDict[(alpha,beta)])+"\n").encode())
I think you’re just sending out a dictionary value associated with the key
(alpha, beta)
+ the breaking of lines, but I may be wrong.– Anthony Accioly
Yes, so it’s a dictionary
– FourZeroFive
What I mean is that your answer gives the impression that the entire dictionary is being converted to a string: Instead of writing "a conversion
str()
dictionary concatenated with a line break" I would use "a conversionstr()
of the value associated with tuple(alpha, beta)
in the dictionarydataDict
concatenated to a line break". It makes sense?– Anthony Accioly