I nedd help with pynton

I nedd help with pynton
i have problem in this code
import serial
import matplotlib.pyplot as plt //library to plot graphs
import time
flag=0
port=”/dev/ttyACM0″
ser=serial.Serial(port,9600)
direction=
angle=
while True:
s=ser.readline() // read values from arduino serially
d=s.split(‘,’)
x=int(d[0],base=10)
y=int(d[1],base=10)
x=float(x)
y=float(y)
direction.append(x)
angle.append(y)
print angle
print direction
if y==180 or y==0:
plt.polar(angle,direction)
plt.show()
direction=
angle=

cvt.PNG

I presume you mean “Python”.

You have not told us what problem you have. What is your code supposed to do, and what does it actually do. The more details you give the better.

Have a look at this Python-Arduino demo. Your code does not seem to allow for the time it takes the Arduino to reset when the serial port is opened.

…R